File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2327,6 +2327,10 @@ def __init__(
23272327 # Close and delete the temporary zipfile
23282328 try :
23292329 zipfileobj .close ()
2330+ # TODO Does catching all possible exceptions really increase
2331+ # the chances of closing the zipfile successully, or does it
2332+ # just mean .close() failures will still fail, but fail
2333+ # silently?
23302334 except : # noqa: E722
23312335 pass
23322336 # Try to load shapefile
@@ -3550,15 +3554,16 @@ def shape(
35503554 # Check is shape or import from geojson
35513555 if not isinstance (s , Shape ):
35523556 if hasattr (s , "__geo_interface__" ):
3553- s = s .__geo_interface__ # type: ignore [assignment]
3557+ shape_dict = cast ( dict , s .__geo_interface__ )
35543558 if isinstance (s , dict ):
3555- s = Shape . _from_geojson ( s )
3559+ shape_dict = s
35563560 else :
35573561 raise TypeError (
35583562 "Can only write Shape objects, GeoJSON dictionaries, "
35593563 "or objects with the __geo_interface__, "
35603564 f"not: { s } "
35613565 )
3566+ s = Shape ._from_geojson (shape_dict )
35623567 # Write to file
35633568 offset , length = self .__shpRecord (s )
35643569 if self .shx :
You can’t perform that action at this time.
0 commit comments