[pypy-commit] pypy py3.3: utilize IsADirectoryError

pjenvey noreply at buildbot.pypy.org
Thu Oct 23 02:16:17 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3.3
Changeset: r74099:cc09e8a517b4
Date: 2014-10-22 17:15 -0700
http://bitbucket.org/pypy/pypy/changeset/cc09e8a517b4/

Log:	utilize IsADirectoryError

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
@@ -286,9 +286,7 @@
         try:
             sys.stdin = sys.__stdin__ = create_stdio(
                 0, False, "<stdin>", encoding, errors, unbuffered)
-        except OSError as e:
-            if e.errno != errno.EISDIR:
-                raise
+        except IsADirectoryError:
             import os
             print("Python error: <stdin> is a directory, cannot continue",
                   file=sys.stderr)


More information about the pypy-commit mailing list