Get rid of deprecated IOError in the doc

This commit is contained in:
Andrew Svetlov 2014-04-01 01:13:30 +03:00
parent 5898d4f4d9
commit 08af00047b
5 changed files with 12 additions and 12 deletions

View file

@ -131,8 +131,8 @@ the exception (allowing a caller to handle the exception as well)::
f = open('myfile.txt')
s = f.readline()
i = int(s.strip())
except IOError as err:
print("I/O error: {0}".format(err))
except OSError as err:
print("OS error: {0}".format(err))
except ValueError:
print("Could not convert data to an integer.")
except: