Author: Philip Jenvey <[email protected]>
Branch: py3.3
Changeset: r74098:e134e7d8f49f
Date: 2014-10-22 17:13 -0700
http://bitbucket.org/pypy/pypy/changeset/e134e7d8f49f/

Log:    merge py3k

diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py
--- a/pypy/interpreter/app_main.py
+++ b/pypy/interpreter/app_main.py
@@ -278,12 +278,21 @@
         else:
             errors = None
 
-        sys.stdin = sys.__stdin__ = create_stdio(
-            0, False, "<stdin>", encoding, errors, unbuffered)
+        sys.stderr = sys.__stderr__ = create_stdio(
+            2, True, "<stderr>", encoding, 'backslashreplace', unbuffered)
         sys.stdout = sys.__stdout__ = create_stdio(
             1, True, "<stdout>", encoding, errors, unbuffered)
-        sys.stderr = sys.__stderr__ = create_stdio(
-            2, True, "<stderr>", encoding, 'backslashreplace', unbuffered)
+
+        try:
+            sys.stdin = sys.__stdin__ = create_stdio(
+                0, False, "<stdin>", encoding, errors, unbuffered)
+        except OSError as e:
+            if e.errno != errno.EISDIR:
+                raise
+            import os
+            print("Python error: <stdin> is a directory, cannot continue",
+                  file=sys.stderr)
+            os._exit(1)
     finally:
         if encerr:
             display_exception(encerr)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to