Show More
@@ -3252,6 +3252,18 b' class TestRunner:' | |||||
3252 | # adds an extension to HGRC. Also include run-test.py directory to |
|
3252 | # adds an extension to HGRC. Also include run-test.py directory to | |
3253 | # import modules like heredoctest. |
|
3253 | # import modules like heredoctest. | |
3254 | pypath = [self._pythondir, self._testdir, runtestdir] |
|
3254 | pypath = [self._pythondir, self._testdir, runtestdir] | |
|
3255 | ||||
|
3256 | # Setting PYTHONPATH with an activated venv causes the modules installed | |||
|
3257 | # in it to be ignored. Therefore, include the related paths in sys.path | |||
|
3258 | # in PYTHONPATH. | |||
|
3259 | virtual_env = osenvironb.get(b"VIRTUAL_ENV") | |||
|
3260 | if virtual_env: | |||
|
3261 | virtual_env = os.path.join(virtual_env, b'') | |||
|
3262 | for p in sys.path: | |||
|
3263 | p = _sys2bytes(p) | |||
|
3264 | if p.startswith(virtual_env): | |||
|
3265 | pypath.append(p) | |||
|
3266 | ||||
3255 | # We have to augment PYTHONPATH, rather than simply replacing |
|
3267 | # We have to augment PYTHONPATH, rather than simply replacing | |
3256 | # it, in case external libraries are only available via current |
|
3268 | # it, in case external libraries are only available via current | |
3257 | # PYTHONPATH. (In particular, the Subversion bindings on OS X |
|
3269 | # PYTHONPATH. (In particular, the Subversion bindings on OS X |
General Comments 0
You need to be logged in to leave comments.
Login now