flatten indentation where it makes sense

This commit is contained in:
Jan Petykiewicz 2024-07-28 19:56:57 -07:00
commit 39d9b88fa4
10 changed files with 22 additions and 25 deletions

View file

@ -220,11 +220,11 @@ def _read_block(block) -> tuple[str, Pattern]:
if points.shape[1] == 2:
raise PatternError('Invalid or unimplemented polygon?')
#shape = Polygon()
elif points.shape[1] > 2:
if points.shape[1] > 2:
if (points[0, 2] != points[:, 2]).any():
raise PatternError('PolyLine has non-constant width (not yet representable in masque!)')
elif points.shape[1] == 4 and (points[:, 3] != 0).any():
if points.shape[1] == 4 and (points[:, 3] != 0).any():
raise PatternError('LWPolyLine has bulge (not yet representable in masque!)')
width = points[0, 2]

View file

@ -604,7 +604,7 @@ def load_libraryfile(
else:
gz_stream = gzip.open(path, mode='rb')
stream = io.BufferedReader(gz_stream) # type: ignore
else:
else: # noqa: PLR5501
if mmap:
base_stream = open(path, mode='rb', buffering=0)
stream = mmap.mmap(base_stream.fileno(), 0, access=mmap.ACCESS_READ) # type: ignore