Skip to content

Commit 0d13044

Browse files
committed
Fix linting for python3.10
1 parent 494d812 commit 0d13044

6 files changed

Lines changed: 8 additions & 9 deletions

File tree

dissect/executable/elf/elf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import io
44
from functools import cached_property, lru_cache
55
from operator import itemgetter
6-
from typing import TYPE_CHECKING, BinaryIO, Callable, Generic, TypeVar
6+
from typing import TYPE_CHECKING, BinaryIO, Generic, TypeVar
77

88
from dissect.executable.elf.c_elf import (
99
SHN,
@@ -19,7 +19,7 @@
1919
from dissect.executable.exception import InvalidSignatureError
2020

2121
if TYPE_CHECKING:
22-
from collections.abc import Iterator
22+
from collections.abc import Callable, Iterator
2323

2424
from dissect.cstruct import cstruct
2525

dissect/executable/pe/c_pe.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Generated by cstruct-stubgen
2-
from typing import BinaryIO, Literal, overload
2+
from typing import BinaryIO, Literal, TypeAlias, overload
33

44
import dissect.cstruct as __cs__
5-
from typing_extensions import TypeAlias
65

76
class _c_pe(__cs__.cstruct):
87
IMAGE_DOS_SIGNATURE: Literal[23117] = ...

dissect/executable/pe/directory/delay_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def functions(self) -> list[DelayImportFunction]:
126126
return [
127127
DelayImportFunction(self, name_thunk, address_thunk, bound_thunk, unload_thunk)
128128
for name_thunk, address_thunk, bound_thunk, unload_thunk in zip(
129-
name_table, address_table, bound_table, unload_table
129+
name_table, address_table, bound_table, unload_table, strict=False
130130
)
131131
]
132132

dissect/executable/pe/directory/export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def functions(self) -> list[ExportFunction]:
7979
self.pe.vfh.seek(self.header.AddressOfNameOrdinals)
8080
ordinals = c_pe.USHORT[self.header.NumberOfNames](self.pe.vfh)
8181

82-
for name_ptr, ordinal in zip(names, ordinals):
82+
for name_ptr, ordinal in zip(names, ordinals, strict=False):
8383
self.pe.vfh.seek(name_ptr)
8484
name = c_pe.CHAR[None](self.pe.vfh).decode()
8585

dissect/executable/pe/directory/imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def functions(self) -> list[ImportFunction]:
108108

109109
return [
110110
ImportFunction(self, lookup_thunk, address_thunk)
111-
for lookup_thunk, address_thunk in zip(lookup_table, address_table)
111+
for lookup_thunk, address_thunk in zip(lookup_table, address_table, strict=False)
112112
]
113113

114114
@cached_property

dissect/executable/pe/directory/resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from functools import cached_property
44
from io import BytesIO
5-
from typing import TYPE_CHECKING, Any, BinaryIO, Union
5+
from typing import TYPE_CHECKING, Any, BinaryIO
66

77
from dissect.util.ts import from_unix, wintimestamp
88

@@ -268,7 +268,7 @@ def vs_version_info(self, language: str | int | None = None) -> dict | None:
268268
if len(version) != 1:
269269
raise ValueError(f"Expected exactly one version resource, found {len(version)}")
270270

271-
_Node: TypeAlias = tuple[str, Union[str, bytes, None], list["_Node"]]
271+
_Node: TypeAlias = tuple[str, str | bytes | None, list["_Node"]]
272272

273273
def _parse_lvt(fh: BinaryIO) -> _Node | None:
274274
start = fh.tell()

0 commit comments

Comments
 (0)