Show More
@@ -138,7 +138,9 b' def _getmtimepaths(ui):' | |||
|
138 | 138 | modules.append(__version__) |
|
139 | 139 | except ImportError: |
|
140 | 140 | pass |
|
141 | files = [pycompat.sysexecutable] | |
|
141 | files = [] | |
|
142 | if pycompat.sysexecutable: | |
|
143 | files.append(pycompat.sysexecutable) | |
|
142 | 144 | for m in modules: |
|
143 | 145 | try: |
|
144 | 146 | files.append(pycompat.fsencode(inspect.getabsfile(m))) |
@@ -1240,7 +1240,7 b' def debuginstall(ui, **opts):' | |||
|
1240 | 1240 | |
|
1241 | 1241 | # Python |
|
1242 | 1242 | fm.write('pythonexe', _("checking Python executable (%s)\n"), |
|
1243 | pycompat.sysexecutable) | |
|
1243 | pycompat.sysexecutable or _("unknown")) | |
|
1244 | 1244 | fm.write('pythonver', _("checking Python version (%s)\n"), |
|
1245 | 1245 | ("%d.%d.%d" % sys.version_info[:3])) |
|
1246 | 1246 | fm.write('pythonlib', _("checking Python lib (%s)...\n"), |
@@ -282,7 +282,16 b' def Popen4(cmd, wd, timeout, env=None):' | |||
|
282 | 282 | |
|
283 | 283 | return p |
|
284 | 284 | |
|
285 | PYTHON = _bytespath(sys.executable.replace('\\', '/')) | |
|
285 | if sys.executable: | |
|
286 | sysexecutable = sys.executable | |
|
287 | elif os.environ.get('PYTHONEXECUTABLE'): | |
|
288 | sysexecutable = os.environ['PYTHONEXECUTABLE'] | |
|
289 | elif os.environ.get('PYTHON'): | |
|
290 | sysexecutable = os.environ['PYTHON'] | |
|
291 | else: | |
|
292 | raise AssertionError('Could not find Python interpreter') | |
|
293 | ||
|
294 | PYTHON = _bytespath(sysexecutable.replace('\\', '/')) | |
|
286 | 295 | IMPL_PATH = b'PYTHONPATH' |
|
287 | 296 | if 'java' in sys.platform: |
|
288 | 297 | IMPL_PATH = b'JYTHONPATH' |
@@ -1094,7 +1103,7 b' class Test(unittest.TestCase):' | |||
|
1094 | 1103 | env["HGRCPATH"] = _strpath(os.path.join(self._threadtmp, b'.hgrc')) |
|
1095 | 1104 | env["DAEMON_PIDS"] = _strpath(os.path.join(self._threadtmp, |
|
1096 | 1105 | b'daemon.pids')) |
|
1097 |
env["HGEDITOR"] = ('"' + sys |
|
|
1106 | env["HGEDITOR"] = ('"' + sysexecutable + '"' | |
|
1098 | 1107 | + ' -c "import sys; sys.exit(0)"') |
|
1099 | 1108 | env["HGUSER"] = "test" |
|
1100 | 1109 | env["HGENCODING"] = "ascii" |
@@ -2349,7 +2358,7 b' class TextTestRunner(unittest.TextTestRu' | |||
|
2349 | 2358 | withhg = self._runner.options.with_hg |
|
2350 | 2359 | if withhg: |
|
2351 | 2360 | opts += ' --with-hg=%s ' % shellquote(_strpath(withhg)) |
|
2352 |
rtc = '%s %s %s %s' % (sys |
|
|
2361 | rtc = '%s %s %s %s' % (sysexecutable, sys.argv[0], opts, | |
|
2353 | 2362 | test) |
|
2354 | 2363 | data = pread(bisectcmd + ['--command', rtc]) |
|
2355 | 2364 | m = re.search( |
@@ -3003,25 +3012,25 b' class TestRunner(object):' | |||
|
3003 | 3012 | # Administrator rights. |
|
3004 | 3013 | if getattr(os, 'symlink', None) and os.name != 'nt': |
|
3005 | 3014 | vlog("# Making python executable in test path a symlink to '%s'" % |
|
3006 |
sys |
|
|
3015 | sysexecutable) | |
|
3007 | 3016 | mypython = os.path.join(self._tmpbindir, pyexename) |
|
3008 | 3017 | try: |
|
3009 |
if os.readlink(mypython) == sys |
|
|
3018 | if os.readlink(mypython) == sysexecutable: | |
|
3010 | 3019 | return |
|
3011 | 3020 | os.unlink(mypython) |
|
3012 | 3021 | except OSError as err: |
|
3013 | 3022 | if err.errno != errno.ENOENT: |
|
3014 | 3023 | raise |
|
3015 |
if self._findprogram(pyexename) != sys |
|
|
3024 | if self._findprogram(pyexename) != sysexecutable: | |
|
3016 | 3025 | try: |
|
3017 |
os.symlink(sys |
|
|
3026 | os.symlink(sysexecutable, mypython) | |
|
3018 | 3027 | self._createdfiles.append(mypython) |
|
3019 | 3028 | except OSError as err: |
|
3020 | 3029 | # child processes may race, which is harmless |
|
3021 | 3030 | if err.errno != errno.EEXIST: |
|
3022 | 3031 | raise |
|
3023 | 3032 | else: |
|
3024 |
exedir, exename = os.path.split(sys |
|
|
3033 | exedir, exename = os.path.split(sysexecutable) | |
|
3025 | 3034 | vlog("# Modifying search path to find %s as %s in '%s'" % |
|
3026 | 3035 | (exename, pyexename, exedir)) |
|
3027 | 3036 | path = os.environ['PATH'].split(os.pathsep) |
@@ -3048,7 +3057,7 b' class TestRunner(object):' | |||
|
3048 | 3057 | |
|
3049 | 3058 | # Run installer in hg root |
|
3050 | 3059 | script = os.path.realpath(sys.argv[0]) |
|
3051 |
exe = sys |
|
|
3060 | exe = sysexecutable | |
|
3052 | 3061 | if PYTHON3: |
|
3053 | 3062 | compiler = _bytespath(compiler) |
|
3054 | 3063 | script = _bytespath(script) |
General Comments 0
You need to be logged in to leave comments.
Login now