Skip to content

Commit acb79c1

Browse files
committed
Add pywin32 type stubs and fix pyright issues
- Add types-pywin32<310.0.0 to dev dependencies (Python 3.8 compatible) - Add inline type ignores for gencache attributes missing from stubs - Pyright now passes with 0 errors, 0 warnings
1 parent e5dbea3 commit acb79c1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libloader/com.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
def prepare_gencache():
1111
logger.debug("Preparing gencache for COM object loading")
12-
gencache.is_readonly = False
13-
gencache.GetGeneratePath()
12+
gencache.is_readonly = False # type: ignore[attr-defined]
13+
gencache.GetGeneratePath() # type: ignore[attr-defined]
1414

1515

1616
def load_com(*names):
1717
logger.debug("Attempting to load COM objects: %s", names)
18-
if gencache.is_readonly:
18+
if gencache.is_readonly: # type: ignore[attr-defined]
1919
prepare_gencache()
2020
result = None
2121
failed_names = []

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dependencies = [
3434
dev = [
3535
"ruff>=0.8.0",
3636
"pyright>=1.1.0",
37+
"types-pywin32<310.0.0",
3738
]
3839

3940
[tool.ruff]

0 commit comments

Comments
 (0)