Bug 802210 - Part 3: Unset PYTHONDONTWRITEBYECODE when creating virtualenv; r=ted

This commit is contained in:
Gregory Szorc 2012-10-22 11:51:08 -07:00
parent 0b95078494
commit 3ba849533e

View File

@ -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.')