Skip to content

Commit

Permalink
fix: Add workaround for faulty mypy detection of sys.foo checks
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpelsepp committed Jan 15, 2025
1 parent d2e30f4 commit 479991e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gallia/transports/flexray_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
from enum import IntEnum, unique
from typing import ClassVar, Self, TypeAlias

if sys.version_info[0] == 3 and sys.version_info[1] < 12:
from more_itertools import chunked as batched
if sys.version_info < (3, 12):
# NOTE: mypy's detection of these magic sys.foo checks is buggy
# and for some reason does not work here.
from more_itertools import chunked as batched # type: ignore[import-not-found]
else:
from itertools import batched

Expand All @@ -20,7 +22,6 @@

assert sys.platform == "win32", "unsupported platform"


logger = get_logger(__name__)


Expand Down

0 comments on commit 479991e

Please sign in to comment.