mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Merge 3.4: Get rid of deprecated IOError in the doc
This commit is contained in:
commit
d6ee27895a
5 changed files with 12 additions and 12 deletions
|
@ -370,7 +370,7 @@ defined to allow. For example::
|
|||
return False
|
||||
retries = retries - 1
|
||||
if retries < 0:
|
||||
raise IOError('uncooperative user')
|
||||
raise OSError('uncooperative user')
|
||||
print(complaint)
|
||||
|
||||
This function can be called in several ways:
|
||||
|
|
|
@ -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