eric7/Globals/__init__.py

branch
eric7
changeset 9016
6f079c524e99
parent 8958
ba80dceeb560
child 9059
e7fd342f8bfc
child 9111
4ac66b6c33a4
--- a/eric7/Globals/__init__.py	Sun Apr 03 17:23:31 2022 +0200
+++ b/eric7/Globals/__init__.py	Mon Apr 04 17:43:43 2022 +0200
@@ -244,6 +244,21 @@
     configDir = os.path.expanduser(d)
 
 
+def getPythonExecutable():
+    """
+    Function to determine the path of the (non-windowed) Python executable.
+    
+    @return path of the Python executable
+    @rtype str
+    """
+    if sys.platform.startswith("linux"):
+        return sys.executable
+    elif sys.platform == "darwin":
+        return sys.executable.replace("pythonw", "python")
+    else:
+        return sys.executable.replace("pythonw.exe", "python.exe")
+
+
 def getPythonLibraryDirectory():
     """
     Function to determine the path to Python's library directory.
@@ -554,7 +569,7 @@
     scriptPath = os.path.join(getConfig("ericDir"), "Tools",
                               "webBrowserSupport.py")
     proc = QProcess()
-    proc.start(sys.executable, [scriptPath, qVersion()])
+    proc.start(getPythonExecutable(), [scriptPath, qVersion()])
     variant = (
         str(proc.readAllStandardOutput(), "utf-8", 'replace').strip()
         if proc.waitForFinished(10000) else

eric ide

mercurial