summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-12-18 18:04:18 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-12-18 18:04:18 +0100
commite3100ae24dd6012a72115da62aac62f1d91f2af0 (patch)
treeb9ea1614d4ef6b8ef8af1b60b2ccf3036931a731
parent3a3c5e62c203d96be38df86b0fc80084a426158d (diff)
downloadtrollius-e3100ae24dd6012a72115da62aac62f1d91f2af0.tar.gz
release.py: fix debug env var
-rw-r--r--release.py34
1 files changed, 20 insertions, 14 deletions
diff --git a/release.py b/release.py
index 24dbd8d..9fd2e0d 100644
--- a/release.py
+++ b/release.py
@@ -18,13 +18,19 @@ import tempfile
import textwrap
PROJECT = 'trollius'
+DEBUG_ENV_VAR = 'TROLLIUSDEBUG'
+PYTHON_VERSIONS = (
+ ((2, 7), 32),
+ ((2, 7), 64),
+
+ ((3, 3), 32),
+ ((3, 3), 64),
+
+ ((3, 4), 32),
+ ((3, 4), 64),
+)
PY3 = (sys.version_info >= (3,))
HG = 'hg'
-_PYTHON_VERSIONS = [(2, 7), (3, 3), (3, 4)]
-PYTHON_VERSIONS = []
-for pyver in _PYTHON_VERSIONS:
- PYTHON_VERSIONS.append((pyver, 32))
- PYTHON_VERSIONS.append((pyver, 64))
SDK_ROOT = r"C:\Program Files\Microsoft SDKs\Windows"
BATCH_FAIL_ON_ERROR = "@IF %errorlevel% neq 0 exit /b %errorlevel%"
@@ -41,15 +47,10 @@ class Release(object):
@contextlib.contextmanager
def _popen(self, args, **kw):
- env2 = kw.pop('env', {})
- env = dict(os.environ)
- # Force the POSIX locale
- env['LC_ALL'] = 'C'
- env.update(env2)
print('+ ' + ' '.join(args))
if PY3:
kw['universal_newlines'] = True
- proc = subprocess.Popen(args, env=env, **kw)
+ proc = subprocess.Popen(args, **kw)
with proc:
yield proc
@@ -146,7 +147,6 @@ class Release(object):
def runtests(self, pyver, bits):
pythonstr = "%s.%s (%s bits)" % (pyver[0], pyver[1], bits)
python = self.get_python(pyver, bits)
- dbg_env = {'PYTHONASYNCIODEBUG': '1'}
self.build(pyver, bits, 'build')
if bits == 64:
@@ -158,9 +158,15 @@ class Release(object):
dst = os.path.join(self.root, PROJECT, '_overlapped.pyd')
shutil.copyfile(src, dst)
+ release_env = dict(os.environ)
+ release_env.pop(DEBUG_ENV_VAR, None)
+
+ dbg_env = dict(os.environ)
+ dbg_env = {DEBUG_ENV_VAR: '1'}
+
args = (python, 'runtests.py', '-r')
print("Run runtests.py in release mode with %s" % pythonstr)
- self.run_command(*args)
+ self.run_command(*args, env=release_env)
print("Run runtests.py in debug mode with %s" % pythonstr)
self.run_command(*args, env=dbg_env)
@@ -168,7 +174,7 @@ class Release(object):
if self.aiotest:
args = (python, 'run_aiotest.py')
print("Run aiotest in release mode with %s" % pythonstr)
- self.run_command(*args)
+ self.run_command(*args, env=release_env)
print("Run aiotest in debug mode with %s" % pythonstr)
self.run_command(*args, env=dbg_env)