(original) (raw)

changeset: 80934:a6ea6f803017 user: Andrew Svetlov andrew.svetlov@gmail.com date: Tue Dec 18 23:16:44 2012 +0200 files: Doc/faq/library.rst description: Mention OSError instead of IOError in the docs. diff -r 50d19c2fac82 -r a6ea6f803017 Doc/faq/library.rst --- a/Doc/faq/library.rst Tue Dec 18 23:10:48 2012 +0200 +++ b/Doc/faq/library.rst Tue Dec 18 23:16:44 2012 +0200 @@ -209,7 +209,7 @@ 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,7 @@ :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. Threads /andrew.svetlov@gmail.com