Submitter | Augie Fackler |
---|---|
Date | Nov. 16, 2016, 5:09 p.m. |
Message ID | <8aade97c1674716721a4.1479316193@augie-macbookair2.roam.corp.google.com> |
Download | mbox | patch |
Permalink | /patch/17600/ |
State | Accepted |
Headers | show |
Comments
On Wed, 16 Nov 2016 12:09:53 -0500, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler <augie@google.com> > # Date 1478812044 18000 > # Thu Nov 10 16:07:24 2016 -0500 > # Node ID 8aade97c1674716721a4b448385c56bb3b904a92 > # Parent a1beadaa406116c0266c46064a00003be7de7394 > run-tests: forward Python USER_BASE from site (issue5425) LGTM, queued the series, thanks.
Patch
diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -58,6 +58,11 @@ import signal import socket import subprocess import sys +try: + import sysconfig +except ImportError: + # sysconfig doesn't exist in Python 2.6 + sysconfig = None import tempfile import threading import time @@ -818,6 +823,8 @@ class Test(unittest.TestCase): offset = '' if i == 0 else '%s' % i env["HGPORT%s" % offset] = '%s' % (self._startport + i) env = os.environ.copy() + if sysconfig is not None: + env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') env['TESTTMP'] = self._testtmp env['HOME'] = self._testtmp # This number should match portneeded in _getport