summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial/errors.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-08-17 05:54:09 (GMT)
committerGeorg Brandl <georg@python.org>2007-08-17 05:54:09 (GMT)
commite9af284e998abe3ab974b488d97c5db69c5aebf4 (patch)
tree42d1e323283ecdf66136d603ad9968413e4831e5 /Doc/tutorial/errors.rst
parented44a1a68b4cc19601a5e7098f63c9e83af41187 (diff)
downloadcpython-e9af284e998abe3ab974b488d97c5db69c5aebf4.zip
cpython-e9af284e998abe3ab974b488d97c5db69c5aebf4.tar.gz
cpython-e9af284e998abe3ab974b488d97c5db69c5aebf4.tar.bz2
No need to define raw_input(), input() does the same.
Diffstat (limited to 'Doc/tutorial/errors.rst')
-rw-r--r--Doc/tutorial/errors.rst8
1 files changed, 1 insertions, 7 deletions
diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst
index 99af9c7..2f2719a 100644
--- a/Doc/tutorial/errors.rst
+++ b/Doc/tutorial/errors.rst
@@ -85,15 +85,9 @@ entered, but allows the user to interrupt the program (using :kbd:`Control-C` or
whatever the operating system supports); note that a user-generated interruption
is signalled by raising the :exc:`KeyboardInterrupt` exception. ::
- >>> def raw_input(prompt):
- ... import sys
- ... sys.stdout.write(prompt)
- ... sys.stdout.flush()
- ... return sys.stdin.readline()
- ...
>>> while True:
... try:
- ... x = int(raw_input("Please enter a number: "))
+ ... x = int(input("Please enter a number: "))
... break
... except ValueError:
... print "Oops! That was no valid number. Try again..."