Skip to content

Commit 903c2a6

Browse files
author
fdrake
committed
Clean up bare except: when determining whether a file is seekable. git-svn-id: http://svn.python.org/projects/python/trunk@20749 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 90c68f2 commit 903c2a6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/chunk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(self, file, align = 1, bigendian = 1, inclheader = 0):
7070
self.size_read = 0
7171
try:
7272
self.offset = self.file.tell()
73-
except:
73+
except (AttributeError, IOError):
7474
self.seekable = 0
7575
else:
7676
self.seekable = 1
@@ -158,7 +158,7 @@ def skip(self):
158158
self.file.seek(n, 1)
159159
self.size_read = self.size_read + n
160160
return
161-
except:
161+
except IOError:
162162
pass
163163
while self.size_read < self.chunksize:
164164
n = min(8192, self.chunksize - self.size_read)

0 commit comments

Comments
 (0)