Patchwork [1,of,2] run-tests: drop fallback for sysconfig for pre-py2.7

login
register
mail settings
Submitter via Mercurial-devel
Date May 16, 2017, 9:53 p.m.
Message ID <e97e9dac1ede83367bdb.1494971599@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/20646/
State Accepted
Headers show

Comments

via Mercurial-devel - May 16, 2017, 9:53 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1494970822 25200
#      Tue May 16 14:40:22 2017 -0700
# Node ID e97e9dac1ede83367bdb494820276f67f0c8f269
# Parent  779a1ae6d0d9eeb487636f665747e92195eb234e
run-tests: drop fallback for sysconfig for pre-py2.7

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -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