Skip to content

Commit 3c58ae9

Browse files
committed
Make except only catch specific exceptions
1 parent f791dae commit 3c58ae9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shapefile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ def __init__(
979979
shp: Union[_NoShpSentinel, Optional[BinaryFileT]] = _NoShpSentinel(),
980980
shx: Optional[BinaryFileT] = None,
981981
dbf: Optional[BinaryFileT] = None,
982-
**kwargs,
982+
**kwargs, # pylint: disable=unused-argument
983983
):
984984
self.shp = None
985985
self.shx = None
@@ -1073,7 +1073,7 @@ def __init__(
10731073
fileobj.seek(0)
10741074
setattr(self, lower_ext, fileobj)
10751075
self._files_to_close.append(fileobj)
1076-
except:
1076+
except (OSError, AttributeError):
10771077
pass
10781078
# Close and delete the temporary zipfile
10791079
try:

0 commit comments

Comments
 (0)