diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-12-18 18:12:00 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-12-18 18:12:00 +0100 |
commit | 5374e09f715cdd5d4bf4a09409e78428cb1a6300 (patch) | |
tree | 1bd587ab52fea0407bc49c6a7603ce93ceb34300 /release.py | |
parent | 132011f2502ea17d1921185852a7bd23bb14be16 (diff) | |
download | trollius-5374e09f715cdd5d4bf4a09409e78428cb1a6300.tar.gz |
release.py: make debug env var configurable
Diffstat (limited to 'release.py')
-rw-r--r-- | release.py | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -18,13 +18,13 @@ import tempfile import textwrap PROJECT = 'asyncio' +DEBUG_ENV_VAR = 'PYTHONASYNCIODEBUG' +PYTHON_VERSIONS = ( + ((3, 3), 32), + ((3, 3), 64), +) PY3 = (sys.version_info >= (3,)) HG = 'hg' -_PYTHON_VERSIONS = [(3, 3)] -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 +41,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 +141,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 +152,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 +168,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) |