Mercurial > public > mercurial-scm > hg
comparison mercurial/chgserver.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 | bce2356ece68 |
children | 0cbe17335857 |
comparison
equal
deleted
inserted
replaced
42522:d29db0a0c4eb | 42523:49998d5ba66a |
---|---|
136 try: | 136 try: |
137 from . import __version__ | 137 from . import __version__ |
138 modules.append(__version__) | 138 modules.append(__version__) |
139 except ImportError: | 139 except ImportError: |
140 pass | 140 pass |
141 files = [pycompat.sysexecutable] | 141 files = [] |
142 if pycompat.sysexecutable: | |
143 files.append(pycompat.sysexecutable) | |
142 for m in modules: | 144 for m in modules: |
143 try: | 145 try: |
144 files.append(pycompat.fsencode(inspect.getabsfile(m))) | 146 files.append(pycompat.fsencode(inspect.getabsfile(m))) |
145 except TypeError: | 147 except TypeError: |
146 pass | 148 pass |