comparison mercurial/debugcommands.py @ 42523:49998d5ba66a

pycompat: make fewer assumptions about sys.executable There are many Python "bundlers" which create an archive to run a Python binary from, and they may not set sys.executable at all - handle that case properly, especially to run tests. Differential Revision: https://phab.mercurial-scm.org/D6575
author Rodrigo Damazio Bovendorp <rdamazio@google.com>
date Tue, 25 Jun 2019 19:28:41 -0700
parents 810f66b468cd
children eb7bd7d64a9d
comparison
equal deleted inserted replaced
42522:d29db0a0c4eb 42523:49998d5ba66a
1238 fm.condwrite(err, 'encodingerror', _(" %s\n" 1238 fm.condwrite(err, 'encodingerror', _(" %s\n"
1239 " (check that your locale is properly set)\n"), err) 1239 " (check that your locale is properly set)\n"), err)
1240 1240
1241 # Python 1241 # Python
1242 fm.write('pythonexe', _("checking Python executable (%s)\n"), 1242 fm.write('pythonexe', _("checking Python executable (%s)\n"),
1243 pycompat.sysexecutable) 1243 pycompat.sysexecutable or _("unknown"))
1244 fm.write('pythonver', _("checking Python version (%s)\n"), 1244 fm.write('pythonver', _("checking Python version (%s)\n"),
1245 ("%d.%d.%d" % sys.version_info[:3])) 1245 ("%d.%d.%d" % sys.version_info[:3]))
1246 fm.write('pythonlib', _("checking Python lib (%s)...\n"), 1246 fm.write('pythonlib', _("checking Python lib (%s)...\n"),
1247 os.path.dirname(pycompat.fsencode(os.__file__))) 1247 os.path.dirname(pycompat.fsencode(os.__file__)))
1248 1248