8000 zipimport: improve bytes handling (#9087) · python/typeshed@9f0d0b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9f0d0b9

Browse files
authored
zipimport: improve bytes handling (#9087)
1 parent 98dac4c commit 9f0d0b9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

stdlib/zipimport.pyi

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import os
21
import sys
2+
from _typeshed import StrOrBytesPath
33
from importlib.abc import ResourceReader
44
from importlib.machinery import ModuleSpec
55
from types import CodeType, ModuleType
6-
from typing import Any
76

87
if sys.version_info >= (3, 8):
98
__all__ = ["ZipImportError", "zipimporter"]
@@ -13,7 +12,11 @@ class ZipImportError(ImportError): ...
1312
class zipimporter:
1413
archive: str
1514
prefix: str
16-
def __init__(self, path: str | bytes | os.PathLike[Any]) -> None: ...
15+
if sys.version_info >= (3, 11):
16+
def __init__(self, path: str) -> None: ...
17+
else:
18+
def __init__(self, path: StrOrBytesPath) -> None: ...
19+
1720
def find_loader(self, fullname: str, path: str | None = ...) -> tuple[zipimporter | None, list[str]]: ... # undocumented
1821
def find_module(self, fullname: str, path: str | None = ...) -> zipimporter | None: ...
1922
def get_code(self, fullname: str) -> CodeType: ...

0 commit comments

Comments
 (0)
0