[pypy-svn] r79161 - in pypy/trunk/pypy/translator/goal: . test2

agaynor at codespeak.net agaynor at codespeak.net
Tue Nov 16 18:43:19 CET 2010


Author: agaynor
Date: Tue Nov 16 18:43:18 2010
New Revision: 79161

Modified:
   pypy/trunk/pypy/translator/goal/app_main.py
   pypy/trunk/pypy/translator/goal/test2/test_app_main.py
Log:
When running pypy with -c '' needs to be on sys.path.


Modified: pypy/trunk/pypy/translator/goal/app_main.py
==============================================================================
--- pypy/trunk/pypy/translator/goal/app_main.py	(original)
+++ pypy/trunk/pypy/translator/goal/app_main.py	Tue Nov 16 18:43:18 2010
@@ -362,6 +362,9 @@
     try:
         if run_command:
             # handle the "-c" command
+            # Put '' on sys.path
+            sys.path.insert(0, '')
+
             def run_it():
                 exec cmd in mainmodule.__dict__
             success = run_toplevel(run_it)

Modified: pypy/trunk/pypy/translator/goal/test2/test_app_main.py
==============================================================================
--- pypy/trunk/pypy/translator/goal/test2/test_app_main.py	(original)
+++ pypy/trunk/pypy/translator/goal/test2/test_app_main.py	Tue Nov 16 18:43:18 2010
@@ -496,6 +496,9 @@
         assert repr(str(tmpdir.join('otherpath'))) in data
         assert "''" not in data
 
+        data = self.run('-c "import sys; print sys.path"')
+        assert data.startswith("[''")
+
 
 class AppTestAppMain:
 



More information about the Pypy-commit mailing list