[pypy-svn] r79739 - pypy/branch/fast-forward/pypy/translator/goal

arigo at codespeak.net arigo at codespeak.net
Thu Dec 2 11:58:34 CET 2010


Author: arigo
Date: Thu Dec  2 11:58:33 2010
New Revision: 79739

Modified:
   pypy/branch/fast-forward/pypy/translator/goal/app_main.py
Log:
Fix the merge from trunk of the -E option.

Modified: pypy/branch/fast-forward/pypy/translator/goal/app_main.py
==============================================================================
--- pypy/branch/fast-forward/pypy/translator/goal/app_main.py	(original)
+++ pypy/branch/fast-forward/pypy/translator/goal/app_main.py	Thu Dec  2 11:58:33 2010
@@ -205,7 +205,7 @@
         break      # found!
     return newpath
 
-def setup_initial_paths(executable, nanos, readenv=True, **extra):
+def setup_initial_paths(executable, nanos, ignore_environment=False, **extra):
     # a substituted os if we are translated
     global os
     os = nanos
@@ -226,6 +226,7 @@
     sys.executable = os.path.abspath(executable)
 
     newpath = get_library_path(executable)
+    readenv = not ignore_environment
     path = readenv and os.getenv('PYTHONPATH')
     if path:
         newpath = path.split(os.pathsep) + newpath
@@ -271,7 +272,6 @@
     options['warnoptions'] = []
     print_sys_flags = False
     i = 0
-    readenv = True
     while i < len(argv):
         arg = argv[i]
         if not arg.startswith('-'):
@@ -311,8 +311,6 @@
             argv[i] = '-c'
             options["run_command"] = True
             break
-        elif arg == '-E':
-            readenv = False
         elif arg == '-u':
             options["unbuffered"] = True
         elif arg == '-O' or arg == '-OO':
@@ -381,7 +379,7 @@
                      run_stdin,
                      warnoptions,
                      unbuffered,
-                     readenv,
+                     ignore_environment,
                      cmd=None,
                      **ignored):
     # with PyPy in top of CPython we can only have around 100 
@@ -403,7 +401,8 @@
         except:
             print >> sys.stderr, "'import site' failed"
 
-    pythonwarnings = os.getenv('PYTHONWARNINGS')
+    readenv = not ignore_environment
+    pythonwarnings = readenv and os.getenv('PYTHONWARNINGS')
     if pythonwarnings:
         warnoptions.extend(pythonwarnings.split(','))
     if warnoptions:



More information about the Pypy-commit mailing list