Skip to content

Commit fb0579a

Browse files
committed
If pythonw found in psgmain or psgupgrade, then switch it to python
1 parent 0b3340e commit fb0579a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

PySimpleGUI.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/python3
2-
version = __version__ = "4.54.0.1 Unreleased"
2+
version = __version__ = "4.54.0.2 Unreleased"
33

44
_change_log = """
55
Changelog since 4.54.0 released to PyPI on 6-Nov-2021
66

77
4.54.0.1
88
Changed the Exec start subprocess/ run py file to use the sys.executable
9-
9+
4.54.0.2
10+
Change from pythonw to python if the main or upgrade sys.executable found to be pythonw. This seems to be the difference when psgupgrade fails.
1011

1112
"""
1213

@@ -22272,14 +22273,20 @@ def _upgrade_entry_point():
2227222273
It simply runs the PySimpleGUI.py file with a command line argument "upgrade" which will
2227322274
actually do the upgrade.
2227422275
"""
22275-
execute_py_file(__file__, 'upgrade', interpreter_command=sys.executable)
22276+
interpreter = sys.executable
22277+
if 'pythonw' in interpreter:
22278+
interpreter.replace('pythonw', 'python')
22279+
execute_py_file(__file__, 'upgrade', interpreter_command=interpreter)
2227622280

2227722281

2227822282

2227922283
def _main_entry_point():
2228022284
# print('Restarting main as a new process...(needed in case you want to GitHub Upgrade)')
2228122285
# Relaunch using the same python interpreter that was used to run this function
22282-
execute_py_file(__file__, interpreter_command=sys.executable)
22286+
interpreter = sys.executable
22287+
if 'pythonw' in interpreter:
22288+
interpreter.replace('pythonw', 'python')
22289+
execute_py_file(__file__, interpreter_command=interpreter)
2228322290

2228422291
main_upgrade_from_github = _upgrade_entry_point
2228522292

0 commit comments

Comments
 (0)