mirror of https://github.com/python/cpython
Closes #28713 uses OSError in the tutorial
This commit is contained in:
commit
dfe2387e79
|
@ -174,7 +174,7 @@ example::
|
|||
for arg in sys.argv[1:]:
|
||||
try:
|
||||
f = open(arg, 'r')
|
||||
except IOError:
|
||||
except OSError:
|
||||
print('cannot open', arg)
|
||||
else:
|
||||
print(arg, 'has', len(f.readlines()), 'lines')
|
||||
|
|
Loading…
Reference in New Issue