From 33b0cdab9e6b7f94e42bd4c2ee13ef8dc5a9f549 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:24:13 +0100 Subject: select elements: message when python path is not correct (#2685) --- lib/extensions/select_elements.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/extensions/select_elements.py') diff --git a/lib/extensions/select_elements.py b/lib/extensions/select_elements.py index 896e04b0..55aae46c 100644 --- a/lib/extensions/select_elements.py +++ b/lib/extensions/select_elements.py @@ -7,9 +7,10 @@ import os import subprocess import sys -from inkex import Boolean +from inkex import Boolean, errormsg from ..elements import Clone, FillStitch, Polyline, SatinColumn, Stroke +from ..i18n import _ from ..utils import get_bundled_dir from .base import InkstitchExtension @@ -67,17 +68,16 @@ class SelectElements(InkstitchExtension): # we are running a local install py_path = sys.executable - # For some reason we cannot use the subprocess method wait() to finish the process properly - # and we'll get a warning. It will break functionality of the selection. - # There is most possibly a better way than to just ignore the warning?!? - with open(os.devnull, 'w') as null: - sys.stderr = null - sys.stdout = null - # custom python path if self.options.python_path: py_path = self.options.python_path + if not os.path.isfile(py_path): + errormsg(_("Could not detect python path. " + "Please insert python path manually as described in the help tab " + "of the select elements dialog.")) + sys.exit(0) + return py_path, file_path def _get_id_list(self): -- cgit v1.2.3