Compare commits

...

2 commits

Author SHA1 Message Date
jan
2512c83749 misc linter cleanup 2026-03-08 20:06:45 -07:00
jan
5cd20f9751 [Path] fix handling of non-int extensions (cast) 2026-03-08 20:06:30 -07:00
3 changed files with 3 additions and 8 deletions

View file

@ -77,7 +77,7 @@ def parse_datetime(data: bytes) -> list[datetime]:
year, *date_parts = parse_int2(data[ii:ii + 12])
try:
dt = datetime(year + 1900, *date_parts)
except ValueError as err:
except ValueError:
dt = datetime(1900, 1, 1, 0, 0, 0)
logger.info(f'Invalid date {[year] + date_parts}, setting {dt} instead')
dts.append(dt)

View file

@ -319,9 +319,9 @@ class Path(Element):
if self.path_type == 4:
bgn_ext, end_ext = self.extension
if bgn_ext != 0:
b += BGNEXTN.write(stream, bgn_ext)
b += BGNEXTN.write(stream, int(bgn_ext))
if end_ext != 0:
b += ENDEXTN.write(stream, end_ext)
b += ENDEXTN.write(stream, int(end_ext))
b += XY.write(stream, self.xy)
b += write_properties(stream, self.properties)
b += ENDEL.write(stream, None)

View file

@ -1,7 +1,3 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "klamath"
description = "GDSII format reader/writer"
@ -84,7 +80,6 @@ lint.ignore = [
"ANN002", # *args
"ANN003", # **kwargs
"ANN401", # Any
"ANN101", # self: Self
"SIM108", # single-line if / else assignment
"RET504", # x=y+z; return x
"PIE790", # unnecessary pass