summaryrefslogtreecommitdiffstats
path: root/Doc/faq
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/faq')
-rw-r--r--Doc/faq/library.rst8
1 files changed, 6 insertions, 2 deletions
diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst
index cab2d7b..6a2682f 100644
--- a/Doc/faq/library.rst
+++ b/Doc/faq/library.rst
@@ -209,7 +209,7 @@ using curses, but curses is a fairly large module to learn.
try:
c = sys.stdin.read(1)
print("Got character", repr(c))
- except IOError:
+ except OSError:
pass
finally:
termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)
@@ -222,7 +222,11 @@ using curses, but curses is a fairly large module to learn.
:func:`termios.tcsetattr` turns off stdin's echoing and disables canonical
mode. :func:`fcntl.fnctl` is used to obtain stdin's file descriptor flags
and modify them for non-blocking mode. Since reading stdin when it is empty
- results in an :exc:`IOError`, this error is caught and ignored.
+ results in an :exc:`OSError`, this error is caught and ignored.
+
+ .. versionchanged:: 3.3
+ *sys.stdin.read* used to raise :exc:`IOError`. Starting from Python 3.3
+ :exc:`IOError` is alias for :exc:`OSError`.
Threads