[pypy-commit] pypy app_main-refactor: fix test_ignore_python_startup: we need to make sure to take a copy of sys.path, because we are going to empty it few lines later (and the bug does not show if PYTHONPATH is set, because then a copy of the list is done anyway)

antocuni noreply at buildbot.pypy.org
Sun Jun 10 17:04:51 CEST 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: app_main-refactor
Changeset: r55544:c02dcde9ad9d
Date: 2012-06-10 16:46 +0200
http://bitbucket.org/pypy/pypy/changeset/c02dcde9ad9d/

Log:	fix test_ignore_python_startup: we need to make sure to take a copy
	of sys.path, because we are going to empty it few lines later (and
	the bug does not show if PYTHONPATH is set, because then a copy of
	the list is done anyway)

diff --git a/pypy/translator/goal/app_main.py b/pypy/translator/goal/app_main.py
--- a/pypy/translator/goal/app_main.py
+++ b/pypy/translator/goal/app_main.py
@@ -231,7 +231,7 @@
 
 
 def setup_and_fix_paths(ignore_environment=False, **extra):
-    newpath = sys.path
+    newpath = sys.path[:]
     readenv = not ignore_environment
     path = readenv and os.getenv('PYTHONPATH')
     if path:


More information about the pypy-commit mailing list