Merge 3.4: Get rid of deprecated IOError in the doc

This commit is contained in:
Andrew Svetlov 2014-04-01 01:14:27 +03:00
commit d6ee27895a
5 changed files with 12 additions and 12 deletions

View file

@ -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:

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: