mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
zipimport: improve bytes handling (#9087)
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import os
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from importlib.abc import ResourceReader
|
||||
from importlib.machinery import ModuleSpec
|
||||
from types import CodeType, ModuleType
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
__all__ = ["ZipImportError", "zipimporter"]
|
||||
@@ -13,7 +12,11 @@ class ZipImportError(ImportError): ...
|
||||
class zipimporter:
|
||||
archive: str
|
||||
prefix: str
|
||||
def __init__(self, path: str | bytes | os.PathLike[Any]) -> None: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __init__(self, path: str) -> None: ...
|
||||
else:
|
||||
def __init__(self, path: StrOrBytesPath) -> None: ...
|
||||
|
||||
def find_loader(self, fullname: str, path: str | None = ...) -> tuple[zipimporter | None, list[str]]: ... # undocumented
|
||||
def find_module(self, fullname: str, path: str | None = ...) -> zipimporter | None: ...
|
||||
def get_code(self, fullname: str) -> CodeType: ...
|
||||
|
||||
Reference in New Issue
Block a user