summaryrefslogtreecommitdiff
path: root/lib/gui
diff options
context:
space:
mode:
authorKate Murphy <hello@kate.io>2019-04-17 21:48:44 -0400
committerKate Murphy <hello@kate.io>2019-04-17 21:48:44 -0400
commit67027f07046aecc9e45785e077ad7ee70b365c0c (patch)
treeead53b46bc8821c03eedac1d55f52229eeec4c93 /lib/gui
parent1edd5c86355bb3bb02754fe729a2b51a3a8b1a60 (diff)
Fix crashed caused by Inkscape reading message from stdout
Diffstat (limited to 'lib/gui')
-rw-r--r--lib/gui/electron.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gui/electron.py b/lib/gui/electron.py
index f1bdeb61..8bc0bcef 100644
--- a/lib/gui/electron.py
+++ b/lib/gui/electron.py
@@ -11,16 +11,19 @@ app_process = None
def open_url(url):
global app
+ # Any output on stdout will crash inkscape.
+ null = open(os.devnull, 'w')
+
if getattr(sys, 'frozen', None) is not None:
electron_path = os.path.join(get_bundled_dir("electron"), "inkstitch-gui")
if sys.platform == "darwin":
electron_path += ".app/Contents/MacOS/inkstitch-gui"
- subprocess.Popen(["open", "-a", electron_path, "--args", url])
+ subprocess.Popen(["open", "-a", electron_path, "--args", url], stdout=null)
else:
app_process = subprocess.Popen([electron_path, url])
else:
# if we're not running in a pyinstaller bundle, run electron directly
- app_process = subprocess.Popen(["yarn", "dev", url], cwd=get_bundled_dir("electron"))
+ app_process = subprocess.Popen(["yarn", "dev", url], cwd=get_bundled_dir("electron"), stdout=null)
return app_process