##// END OF EJS Templates
tests: use PYTHONSAFEPATH (-P) to check mercurial lib path
paugier -
r53210:0b708a37 default
parent child Browse files
Show More
@@ -4072,8 +4072,14 class TestRunner:
4072 if self._hgpath is not None:
4072 if self._hgpath is not None:
4073 return self._hgpath
4073 return self._hgpath
4074
4074
4075 cmd = b'"%s" -c "import mercurial; print (mercurial.__path__[0])"'
4075 # PYTHONSAFEPATH (-P) new in 3.11
4076 cmd = _bytes2sys(cmd % PYTHON)
4076 if sys.version_info >= (3, 11, 0):
4077 python_safe_path = b"-P "
4078 else:
4079 python_safe_path = b""
4080
4081 cmd = b'"%s" %s-c "import mercurial; print (mercurial.__path__[0])"'
4082 cmd = _bytes2sys(cmd % (PYTHON, python_safe_path))
4077
4083
4078 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
4084 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
4079 out, err = p.communicate()
4085 out, err = p.communicate()
General Comments 0
You need to be logged in to leave comments. Login now