kopia lustrzana https://github.com/inkstitch/inkstitch
Fix crashed caused by Inkscape reading message from stdout
rodzic
1edd5c8635
commit
67027f0704
|
@ -11,16 +11,19 @@ app_process = None
|
||||||
def open_url(url):
|
def open_url(url):
|
||||||
global app
|
global app
|
||||||
|
|
||||||
|
# Any output on stdout will crash inkscape.
|
||||||
|
null = open(os.devnull, 'w')
|
||||||
|
|
||||||
if getattr(sys, 'frozen', None) is not None:
|
if getattr(sys, 'frozen', None) is not None:
|
||||||
electron_path = os.path.join(get_bundled_dir("electron"), "inkstitch-gui")
|
electron_path = os.path.join(get_bundled_dir("electron"), "inkstitch-gui")
|
||||||
|
|
||||||
if sys.platform == "darwin":
|
if sys.platform == "darwin":
|
||||||
electron_path += ".app/Contents/MacOS/inkstitch-gui"
|
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:
|
else:
|
||||||
app_process = subprocess.Popen([electron_path, url])
|
app_process = subprocess.Popen([electron_path, url])
|
||||||
else:
|
else:
|
||||||
# if we're not running in a pyinstaller bundle, run electron directly
|
# 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
|
return app_process
|
||||||
|
|
Ładowanie…
Reference in New Issue