Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r55477:237bdac6939b
Date: 2012-06-07 14:32 +0200
http://bitbucket.org/pypy/pypy/changeset/237bdac6939b/

Log:    make sure to init sys.std{in,out,err} only if they are not
        initialized yet. This fixes the first few tests in test_app_main,
        which rely on stdout to be a StringIO()

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
@@ -285,6 +285,8 @@
             _seen[dir] = True
 
 def initstdio(encoding=None, unbuffered=False):
+    if hasattr(sys, 'stdin'):
+        return # already initialized
     if not encoding:
         encoding = sys.getfilesystemencoding()
     if ':' in encoding:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to