Changeset View
Changeset View
Standalone View
Standalone View
www/firefox/files/patch-bug1288587
Show All 37 Lines | + pass | ||||
with LineIO(lambda l: log.error(l)) as out: | with LineIO(lambda l: log.error(l)) as out: | ||||
verify_python_version(out) | verify_python_version(out) | ||||
topsrcdir, topobjdir = build_env.topsrcdir, build_env.topobjdir | topsrcdir, topobjdir = build_env.topsrcdir, build_env.topobjdir | ||||
if topobjdir.endswith('/js/src'): | if topobjdir.endswith('/js/src'): | ||||
topobjdir = topobjdir[:-7] | topobjdir = topobjdir[:-7] | ||||
with LineIO(lambda l: log.info(l)) as out: | with LineIO(lambda l: log.info(l)) as out: | ||||
@@ -219,17 +226,20 @@ def virtualenv_python(env_python, build_env, mozconfig, help): | @@ -255,17 +262,20 @@ def virtualenv_python(env_python, build_env, mozconfig | ||||
log.info('Creating Python environment') | log.info('Creating Python environment') | ||||
manager.build(python) | manager.build(python) | ||||
python = normsep(manager.python_path) | python = normsep(manager.python_path) | ||||
if python != normsep(sys.executable): | if not normsep(sys.executable).startswith(normsep(virtualenvs_root)): | ||||
log.info('Reexecuting in the virtualenv') | log.info('Reexecuting in the virtualenv') | ||||
if env_python: | if env_python: | ||||
- del os.environ['PYTHON'] | - del os.environ['PYTHON'] | ||||
+ try: | + try: | ||||
+ del os.environ['PYTHON'] | + del os.environ['PYTHON'] | ||||
+ except KeyError: | + except KeyError: | ||||
+ pass | + pass | ||||
# One would prefer to use os.execl, but that's completely borked on | # One would prefer to use os.execl, but that's completely borked on | ||||
# Windows. | # Windows. | ||||
sys.exit(subprocess.call([python] + sys.argv)) | sys.exit(subprocess.call([python] + sys.argv)) | ||||
# We are now in the virtualenv | # We are now in the virtualenv | ||||
if not distutils.sysconfig.get_python_lib(): | if not distutils.sysconfig.get_python_lib(): | ||||
die('Could not determine python site packages directory') | die('Could not determine python site packages directory') | ||||