[pypy-svn] r79128 - in pypy/release/1.4.x: . pypy pypy/jit/metainterp/optimizeopt pypy/module/array/benchmark pypy/module/array/test pypy/rlib pypy/rlib/test pypy/translator/goal pypy/translator/goal/test2

fijal at codespeak.net fijal at codespeak.net
Mon Nov 15 20:11:32 CET 2010


Author: fijal
Date: Mon Nov 15 20:11:31 2010
New Revision: 79128

Modified:
   pypy/release/1.4.x/   (props changed)
   pypy/release/1.4.x/pypy/   (props changed)
   pypy/release/1.4.x/pypy/jit/metainterp/optimizeopt/optimizer.py   (props changed)
   pypy/release/1.4.x/pypy/module/array/benchmark/Makefile   (props changed)
   pypy/release/1.4.x/pypy/module/array/benchmark/intimg.c   (props changed)
   pypy/release/1.4.x/pypy/module/array/benchmark/intimgtst.c   (props changed)
   pypy/release/1.4.x/pypy/module/array/benchmark/intimgtst.py   (props changed)
   pypy/release/1.4.x/pypy/module/array/benchmark/loop.c   (props changed)
   pypy/release/1.4.x/pypy/module/array/benchmark/sum.c   (props changed)
   pypy/release/1.4.x/pypy/module/array/benchmark/sumtst.c   (props changed)
   pypy/release/1.4.x/pypy/module/array/benchmark/sumtst.py   (props changed)
   pypy/release/1.4.x/pypy/module/array/test/test_array_old.py   (props changed)
   pypy/release/1.4.x/pypy/rlib/rerased.py   (props changed)
   pypy/release/1.4.x/pypy/rlib/test/test_rerased.py   (props changed)
   pypy/release/1.4.x/pypy/translator/goal/app_main.py
   pypy/release/1.4.x/pypy/translator/goal/test2/test_app_main.py
Log:
merge 79011 from trunk

Modified: pypy/release/1.4.x/pypy/translator/goal/app_main.py
==============================================================================
--- pypy/release/1.4.x/pypy/translator/goal/app_main.py	(original)
+++ pypy/release/1.4.x/pypy/translator/goal/app_main.py	Mon Nov 15 20:11:31 2010
@@ -326,10 +326,6 @@
         except:
             print >> sys.stderr, "'import site' failed"
 
-    # update sys.path *after* loading site.py, in case there is a
-    # "site.py" file in the script's directory.
-    sys.path.insert(0, '')
-
     if warnoptions:
         sys.warnoptions.append(warnoptions)
         from warnings import _processoptions
@@ -378,6 +374,13 @@
         elif run_stdin:
             # handle the case where no command/filename/module is specified
             # on the command-line.
+
+            # update sys.path *after* loading site.py, in case there is a
+            # "site.py" file in the script's directory. Only run this if we're
+            # executing the interactive prompt, if we're running a script we
+            # put it's directory on sys.path
+            sys.path.insert(0, '')
+
             if go_interactive or sys.stdin.isatty():
                 # If stdin is a tty or if "-i" is specified, we print
                 # a banner and run $PYTHONSTARTUP.

Modified: pypy/release/1.4.x/pypy/translator/goal/test2/test_app_main.py
==============================================================================
--- pypy/release/1.4.x/pypy/translator/goal/test2/test_app_main.py	(original)
+++ pypy/release/1.4.x/pypy/translator/goal/test2/test_app_main.py	Mon Nov 15 20:11:31 2010
@@ -95,6 +95,11 @@
         child.expect('>>> ')
         child.sendline('__name__')
         child.expect("'__main__'")
+        child.expect('>>> ')
+        child.sendline('import sys')
+        child.expect('>>> ')
+        child.sendline("'' in sys.path")
+        child.expect("True")
 
     def test_run_script(self):
         child = self.spawn([demo_script])
@@ -487,9 +492,9 @@
 
         with chdir_and_unset_pythonpath(tmpdir):
             data = self.run(cmdline2, python_flags='-S')
-
         assert data.startswith("some new text\n")
         assert repr(str(tmpdir.join('otherpath'))) in data
+        assert "''" not in data
 
 
 class AppTestAppMain:



More information about the Pypy-commit mailing list