Mercurial > public > mercurial-scm > hg-stable
diff tests/run-tests.py @ 49260:cd51d4957b28
branching: merge stable into default
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 02 Jun 2022 16:24:06 +0200 |
parents | 13dfad0f9f7a 9dad328434c7 |
children | 56f98406831b |
line wrap: on
line diff
--- a/tests/run-tests.py Fri May 27 02:54:20 2022 +0200 +++ b/tests/run-tests.py Thu Jun 02 16:24:06 2022 +0200 @@ -969,6 +969,10 @@ return killmod.killdaemons(pidfile, tryhard=False, remove=True, logfn=vlog) +# sysconfig is not thread-safe (https://github.com/python/cpython/issues/92452) +sysconfiglock = threading.Lock() + + class Test(unittest.TestCase): """Encapsulates a single, runnable test. @@ -1399,7 +1403,8 @@ env["HGPORT%s" % offset] = '%s' % (self._startport + i) env = os.environ.copy() - env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or '' + with sysconfiglock: + env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or '' env['HGEMITWARNINGS'] = '1' env['TESTTMP'] = _bytes2sys(self._testtmp) # the FORWARD_SLASH version is useful when running `sh` on non unix