Closes #28713 uses OSError in the tutorial

This commit is contained in:
Kushal Das 2016-11-16 21:17:54 +05:30
commit dfe2387e79
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ example::
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
try: try:
f = open(arg, 'r') f = open(arg, 'r')
except IOError: except OSError:
print('cannot open', arg) print('cannot open', arg)
else: else:
print(arg, 'has', len(f.readlines()), 'lines') print(arg, 'has', len(f.readlines()), 'lines')