[pypy-svn] r46675 - pypy/dist/pypy/bin

arigo at codespeak.net arigo at codespeak.net
Sun Sep 16 13:18:56 CEST 2007


Author: arigo
Date: Sun Sep 16 13:18:55 2007
New Revision: 46675

Modified:
   pypy/dist/pypy/bin/py.py
Log:
Only import 'readline' when going interactive.  This caused a failure in
test_import.py, which got confused by escape characters printed by
readline.  For mysterious reasons this failure only started to occur
today, and only on my laptop.


Modified: pypy/dist/pypy/bin/py.py
==============================================================================
--- pypy/dist/pypy/bin/py.py	(original)
+++ pypy/dist/pypy/bin/py.py	Sun Sep 16 13:18:55 2007
@@ -122,6 +122,10 @@
 
             # start the interactive console
             if go_interactive or getenv_w(space, 'PYTHONINSPECT'):
+                try:
+                    import readline
+                except:
+                    pass
                 con = interactive.PyPyConsole(
                     space, verbose=interactiveconfig.verbose,
                     completer=interactiveconfig.completer)
@@ -139,10 +143,6 @@
 
 
 if __name__ == '__main__':
-    try:
-        import readline
-    except:
-        pass
     if hasattr(sys, 'setrecursionlimit'):
         # for running "python -i py.py -Si -- py.py -Si" 
         sys.setrecursionlimit(3000)



More information about the Pypy-commit mailing list