Skip to content

Commit 6d204af

Browse files
msilib: fix type annotation
1 parent 23246f8 commit 6d204af

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

stdlib/_msi.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if sys.platform == "win32":
5252
__init__: None # type: ignore[assignment]
5353

5454
def UuidCreate() -> str: ...
55-
def FCICreate(cabname: str, files: list[str], /) -> None: ...
55+
def FCICreate(cabname: str, files: list[tuple[str, str]], /) -> None: ...
5656
def OpenDatabase(path: str, persist: int, /) -> _Database: ...
5757
def CreateRecord(count: int, /) -> _Record: ...
5858

stdlib/msilib/__init__.pyi

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import sys
2-
from collections.abc import Container, Iterable, Sequence
2+
from collections.abc import Container, Iterable
33
from types import ModuleType
44
from typing import Any, Final
55

66
if sys.platform == "win32":
77
from _msi import *
88
from _msi import _Database
9+
from .sequence import _SequenceType
910

1011
AMD64: Final[bool]
1112
Win64: Final[bool]
@@ -33,7 +34,7 @@ if sys.platform == "win32":
3334
class _Unspecified: ...
3435

3536
def change_sequence(
36-
seq: Sequence[tuple[str, str | None, int]],
37+
seq: _SequenceType,
3738
action: str,
3839
seqno: int | type[_Unspecified] = ...,
3940
cond: str | type[_Unspecified] = ...,
@@ -54,15 +55,15 @@ if sys.platform == "win32":
5455
index: int
5556
def __init__(self, name: str) -> None: ...
5657
def gen_id(self, file: str) -> str: ...
57-
def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ...
58+
def append(self, full: str, file: str, logical: str | None) -> tuple[int, str] | None: ...
5859
def commit(self, db: _Database) -> None: ...
5960

6061
_directories: set[str]
6162

6263
class Directory:
6364
db: _Database
6465
cab: CAB
65-
basedir: str
66+
basedir: Directory | None
6667
physical: str
6768
logical: str
6869
component: str | None
@@ -75,7 +76,7 @@ if sys.platform == "win32":
7576
self,
7677
db: _Database,
7778
cab: CAB,
78-
basedir: str,
79+
basedir: Directory | None,
7980
physical: str,
8081
_logical: str,
8182
default: str,
@@ -90,7 +91,7 @@ if sys.platform == "win32":
9091
uuid: str | None = None,
9192
) -> None: ...
9293
def make_short(self, file: str) -> str: ...
93-
def add_file(self, file: str, src: str | None = None, version: str | None = None, language: str | None = None) -> str: ...
94+
def add_file(self, file: str, src: str | None = None, version: str | None = None, language: str | None = None) -> str | None: ...
9495
def glob(self, pattern: str, exclude: Container[str] | None = None) -> list[str]: ...
9596
def remove_pyc(self) -> None: ...
9697

@@ -146,8 +147,8 @@ if sys.platform == "win32":
146147
attr: int,
147148
title: str,
148149
first: str,
149-
default: str,
150-
cancel: str,
150+
default: str | None,
151+
cancel: str | None,
151152
) -> None: ...
152153
def control(
153154
self,

0 commit comments

Comments
 (0)