From 3ba849533e41b0c08565cfca839c7f6735853a74 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Mon, 22 Oct 2012 11:51:08 -0700 Subject: [PATCH] Bug 802210 - Part 3: Unset PYTHONDONTWRITEBYECODE when creating virtualenv; r=ted --- build/virtualenv/populate_virtualenv.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build/virtualenv/populate_virtualenv.py b/build/virtualenv/populate_virtualenv.py index e734021521d..b087a11648b 100755 --- a/build/virtualenv/populate_virtualenv.py +++ b/build/virtualenv/populate_virtualenv.py @@ -89,11 +89,17 @@ class VirtualenvManager(object): called out to), the path to create the virtualenv in, and a handle to write output to. """ + env = dict(os.environ) + try: + del env['PYTHONDONTWRITEBYTECODE'] + except KeyError: + pass + args = [sys.executable, self.virtualenv_script_path, '--system-site-packages', self.virtualenv_root] result = subprocess.call(args, stdout=self.log_handle, - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT, env=env) if result != 0: raise Exception('Error creating virtualenv.')