mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
- Fix for #862941: "run with commandline python" crashed. Fixed.
- Prefer to use pythonw (if it exists) for "run with commandline python".
This commit is contained in:
parent
22ec5c3639
commit
30184f3611
1 changed files with 5 additions and 2 deletions
|
@ -540,14 +540,17 @@ class Editor(W.Window):
|
||||||
|
|
||||||
def _run_with_cl_interpreter(self):
|
def _run_with_cl_interpreter(self):
|
||||||
import Terminal
|
import Terminal
|
||||||
interp_path = os.path.join(sys.exec_prefix, "bin", "python")
|
interp_path = os.path.join(sys.exec_prefix,
|
||||||
|
"Resources", "Python.app", "Contents", "MacOS", "Python")
|
||||||
|
if not os.path.exists(interp_path):
|
||||||
|
interp_path = os.path.join(sys.exec_prefix, "bin", "python")
|
||||||
file_path = self.path
|
file_path = self.path
|
||||||
if not os.path.exists(interp_path):
|
if not os.path.exists(interp_path):
|
||||||
# This "can happen" if we are running IDE under MacPython-OS9.
|
# This "can happen" if we are running IDE under MacPython-OS9.
|
||||||
raise W.AlertError, "Can't find command-line Python"
|
raise W.AlertError, "Can't find command-line Python"
|
||||||
cmd = '"%s" "%s" ; exit' % (interp_path, file_path)
|
cmd = '"%s" "%s" ; exit' % (interp_path, file_path)
|
||||||
t = Terminal.Terminal()
|
t = Terminal.Terminal()
|
||||||
t.do_script(with_command=cmd)
|
t.do_script(cmd)
|
||||||
|
|
||||||
def runselection(self):
|
def runselection(self):
|
||||||
self._runselection()
|
self._runselection()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue