mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Get rid of deprecated IOError in the doc
This commit is contained in:
parent
5898d4f4d9
commit
08af00047b
5 changed files with 12 additions and 12 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue