Skip to content

Commit 2601071

Browse files
committed
Run ruff --fix --unsafe-fixes
1 parent cd24957 commit 2601071

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

shapefile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def __geo_interface__(self):
543543
ps = None
544544
coordinates = []
545545
for part in self.parts:
546-
if ps == None:
546+
if ps is None:
547547
ps = part
548548
continue
549549
else:
@@ -1474,7 +1474,7 @@ def __shapeIndex(self, i=None):
14741474
in the .shx index file."""
14751475
shx = self.shx
14761476
# Return None if no shx or no index requested
1477-
if not shx or i == None:
1477+
if not shx or i is None:
14781478
return None
14791479
# At this point, we know the shx file exists
14801480
if not self._offsets:

test_shapefile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ def test_reader_numshapes():
10681068
basename = "shapefiles/blockgroups"
10691069
with shapefile.Reader(basename) as sf:
10701070
# numShapes should be set during loading
1071-
assert sf.numShapes != None
1071+
assert sf.numShapes is not None
10721072
# numShapes should equal the number of shapes
10731073
assert sf.numShapes == len(sf.shapes())
10741074

@@ -1084,7 +1084,7 @@ def test_reader_numshapes_no_shx():
10841084
dbf = open(basename + ".dbf", "rb")
10851085
with shapefile.Reader(shp=shp, dbf=dbf) as sf:
10861086
# numShapes should be unknown due to missing shx file
1087-
assert sf.numShapes == None
1087+
assert sf.numShapes is None
10881088
# numShapes should be set after reading all the shapes
10891089
shapes = sf.shapes()
10901090
assert sf.numShapes == len(shapes)

0 commit comments

Comments
 (0)