src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUtilities.py

branch
eric7
changeset 9420
92810aebc909
parent 9413
80c06d472826
child 9473
3f23dbf37dbe
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUtilities.py	Tue Oct 18 17:02:51 2022 +0200
+++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgUtilities.py	Tue Oct 18 17:48:03 2022 +0200
@@ -9,7 +9,6 @@
 
 import os
 import re
-import sys
 
 from PyQt6.QtCore import QProcess, QProcessEnvironment, QCoreApplication
 
@@ -31,15 +30,10 @@
         program = "hg"
         if isWindowsPlatform():
             program += ".exe"
-            dirName = os.path.dirname(sys.executable)
-            if os.path.exists(os.path.join(dirName, program)):
-                exe = os.path.join(dirName, program)
-            elif os.path.exists(os.path.join(dirName, "Scripts", program)):
-                exe = os.path.join(dirName, "Scripts", program)
-        else:
-            dirName = os.path.dirname(sys.executable)
-            if os.path.exists(os.path.join(dirName, program)):
-                exe = os.path.join(dirName, program)
+
+        progPath = os.path.join(Utilities.getPythonScriptsDirectory(), program)
+        if os.path.exists(progPath):
+            exe = progPath
 
         if not exe:
             exe = program

eric ide

mercurial