run-tests: drop fallback for sysconfig for pre-py2.7
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 16 May 2017 14:40:22 -0700
changeset 32302 8627cf4de929
parent 32301 8a87bfc5bebb
child 32303 dc131b9772f2
run-tests: drop fallback for sysconfig for pre-py2.7
tests/run-tests.py
--- a/tests/run-tests.py	Tue May 16 17:47:27 2017 -0700
+++ b/tests/run-tests.py	Tue May 16 14:40:22 2017 -0700
@@ -58,11 +58,7 @@
 import socket
 import subprocess
 import sys
-try:
-    import sysconfig
-except ImportError:
-    # sysconfig doesn't exist in Python 2.6
-    sysconfig = None
+import sysconfig
 import tempfile
 import threading
 import time
@@ -882,8 +878,7 @@
             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['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase')
         env['HGEMITWARNINGS'] = '1'
         env['TESTTMP'] = self._testtmp
         env['HOME'] = self._testtmp