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