##// END OF EJS Templates
py3: replace sys.executable with pycompat.sysexecutable...
Pulkit Goyal -
r30669:10b17ed9 default
parent child Browse files
Show More
@@ -47,7 +47,6 b' import os'
47 47 import re
48 48 import signal
49 49 import struct
50 import sys
51 50 import time
52 51
53 52 from .i18n import _
@@ -59,6 +58,7 b' from . import ('
59 58 error,
60 59 extensions,
61 60 osutil,
61 pycompat,
62 62 util,
63 63 )
64 64
@@ -122,7 +122,7 b' def _getmtimepaths(ui):'
122 122 modules.append(__version__)
123 123 except ImportError:
124 124 pass
125 files = [sys.executable]
125 files = [pycompat.sysexecutable]
126 126 for m in modules:
127 127 try:
128 128 files.append(inspect.getabsfile(m))
@@ -1889,7 +1889,7 b' def debuginstall(ui, **opts):'
1889 1889
1890 1890 # Python
1891 1891 fm.write('pythonexe', _("checking Python executable (%s)\n"),
1892 sys.executable)
1892 pycompat.sysexecutable)
1893 1893 fm.write('pythonver', _("checking Python version (%s)\n"),
1894 1894 ("%d.%d.%d" % sys.version_info[:3]))
1895 1895 fm.write('pythonlib', _("checking Python lib (%s)...\n"),
@@ -19,7 +19,7 b' from . import ('
19 19
20 20 # modelled after templater.templatepath:
21 21 if getattr(sys, 'frozen', None) is not None:
22 module = sys.executable
22 module = pycompat.sysexecutable
23 23 else:
24 24 module = __file__
25 25
@@ -669,9 +669,9 b' def _plainapplepython():'
669 669 cacerts file
670 670 """
671 671 if (pycompat.sysplatform != 'darwin' or
672 util.mainfrozen() or not sys.executable):
672 util.mainfrozen() or not pycompat.sysexecutable):
673 673 return False
674 exe = os.path.realpath(sys.executable).lower()
674 exe = os.path.realpath(pycompat.sysexecutable).lower()
675 675 return (exe.startswith('/usr/bin/python') or
676 676 exe.startswith('/system/library/frameworks/python.framework/'))
677 677
@@ -931,7 +931,7 b' def mainfrozen():'
931 931 # the location of data files matching the source code
932 932 if mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app':
933 933 # executable version (py2exe) doesn't support __file__
934 datapath = os.path.dirname(sys.executable)
934 datapath = os.path.dirname(pycompat.sysexecutable)
935 935 else:
936 936 datapath = os.path.dirname(__file__)
937 937
@@ -957,7 +957,7 b' def hgexecutable():'
957 957 # Env variable set by py2app
958 958 _sethgexecutable(encoding.environ['EXECUTABLEPATH'])
959 959 else:
960 _sethgexecutable(sys.executable)
960 _sethgexecutable(pycompat.sysexecutable)
961 961 elif os.path.basename(getattr(mainmod, '__file__', '')) == 'hg':
962 962 _sethgexecutable(mainmod.__file__)
963 963 else:
@@ -2299,7 +2299,7 b' def hgcmd():'
2299 2299 # Env variable set by py2app
2300 2300 return [encoding.environ['EXECUTABLEPATH']]
2301 2301 else:
2302 return [sys.executable]
2302 return [pycompat.sysexecutable]
2303 2303 return gethgcmd()
2304 2304
2305 2305 def rundetached(args, condfn):
General Comments 0
You need to be logged in to leave comments. Login now