]> granicus.if.org Git - python/commitdiff
- Fix for #862941: "run with commandline python" crashed. Fixed.
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 3 Jun 2004 21:27:15 +0000 (21:27 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 3 Jun 2004 21:27:15 +0000 (21:27 +0000)
- Prefer to use pythonw (if it exists) for "run with commandline python".

Mac/Tools/IDE/PyEdit.py

index 6826c658661b57f2b4c603dd602832dd6614f01f..e21fda54cf568a6d8d16f5d37e71b4e10ca0db80 100644 (file)
@@ -540,14 +540,17 @@ class Editor(W.Window):
 
        def _run_with_cl_interpreter(self):
                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
                if not os.path.exists(interp_path):
                        # This "can happen" if we are running IDE under MacPython-OS9.
                        raise W.AlertError, "Can't find command-line Python"
                cmd = '"%s" "%s" ; exit' % (interp_path, file_path)
                t = Terminal.Terminal()
-               t.do_script(with_command=cmd)
+               t.do_script(cmd)
        
        def runselection(self):
                self._runselection()