|
40 | 40 | from pre_workbench import windows |
41 | 41 | from pre_workbench.configs import getIcon, SettingsSection, SettingsField, icon_searchpaths |
42 | 42 | from pre_workbench.datawidgets import DynamicDataWidget |
43 | | -from pre_workbench.util import get_app_version, SimpleThread |
| 43 | +from pre_workbench.util import get_app_version, SimpleThread, get_exe_for_reloading |
44 | 44 | from pre_workbench.windows.content.objectwindow import ObjectWindow |
45 | 45 | from pre_workbench.windows.dialogs.manageannotationsets import ManageAnnotationSetsDialog |
46 | 46 | # noinspection PyUnresolvedReferences |
@@ -581,14 +581,7 @@ def onProjectOpenAction(self): |
581 | 581 |
|
582 | 582 | def openProjectInNewWindow(self, projectPath = "--choose-project"): |
583 | 583 | import subprocess |
584 | | - self_script = sys.argv[0] |
585 | | - # weird Windows magic |
586 | | - if self_script == sys.executable: # PyInstaller on Windows |
587 | | - cmd_line = [self_script, projectPath] |
588 | | - elif not os.path.exists(self_script) and os.path.exists(self_script + '.exe'): # PIP entry_points on Windows |
589 | | - cmd_line = [sys.executable, self_script + '.exe', projectPath] |
590 | | - else: # everything else |
591 | | - cmd_line = [sys.executable, self_script, projectPath] |
| 584 | + cmd_line = get_exe_for_reloading() + [projectPath] |
592 | 585 | logging.info('Starting new instance with cmd line: %r', cmd_line) |
593 | 586 | subprocess.Popen(cmd_line, stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
594 | 587 |
|
|
0 commit comments