summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-05-15 19:24:30 +0200
committerGitHub <noreply@github.com>2025-05-15 19:24:30 +0200
commita09f8586bfe964aa2ccc49e1fc9a3586eb559c59 (patch)
tree7671282f75d6af16e45ff2de5c975f535e3ffde6
parent60459fca12d660c20783952c3811c50c03d1d6d5 (diff)
fix undefined exit and improve error message (#3727)
-rw-r--r--inkstitch.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/inkstitch.py b/inkstitch.py
index 21bb0281..efe6f6de 100644
--- a/inkstitch.py
+++ b/inkstitch.py
@@ -29,7 +29,7 @@ logger = logging.getLogger("inkstitch") # create module logger with name 'inks
old_debug_ini = SCRIPTDIR / "DEBUG.ini"
if old_debug_ini.exists():
print("ERROR: old DEBUG.ini exists, please reformat it to DEBUG.toml and remove DEBUG.ini file", file=sys.stderr)
- exit(1)
+ sys.exit(1)
# --- end of temporary ---
debug_toml = SCRIPTDIR / "DEBUG.toml"
@@ -49,6 +49,10 @@ if not running_as_frozen: # override running_as_frozen from DEBUG.toml - for te
if len(sys.argv) < 2:
# no arguments - prevent accidentally running this script
msg = "No arguments given, exiting!" # without gettext localization see _()
+ msg += "\n\n"
+ msg += "Ink/Stitch is an Inkscape extension."
+ msg += "\n\n"
+ msg += "Please enter arguments or run Ink/Stitch through the Inkscape extensions menu."
if running_as_frozen: # we show dialog only when running from pyinstaller bundle - using wx
try:
import wx
@@ -60,7 +64,7 @@ if len(sys.argv) < 2:
print(msg, file=sys.stderr)
else:
print(msg, file=sys.stderr)
- exit(1)
+ sys.exit(1)
# activate logging - must be done before any logging is done
debug_logging.activate_logging(running_as_frozen, ini, SCRIPTDIR)