From 61f232c7d8af519e848d19f616c89a720de8f8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rousset?= Date: Mon, 18 Jul 2016 06:05:05 +0200 Subject: [PATCH] add py3 version to zipimport (#305) --- stdlib/{2.7 => 2and3}/zipimport.pyi | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) rename stdlib/{2.7 => 2and3}/zipimport.pyi (54%) diff --git a/stdlib/2.7/zipimport.pyi b/stdlib/2and3/zipimport.pyi similarity index 54% rename from stdlib/2.7/zipimport.pyi rename to stdlib/2and3/zipimport.pyi index b972a37f1..2408d108b 100644 --- a/stdlib/2.7/zipimport.pyi +++ b/stdlib/2and3/zipimport.pyi @@ -1,25 +1,19 @@ """Stub file for the 'zipimport' module.""" -from typing import Dict, Optional +from typing import Optional from types import CodeType, ModuleType -class ZipImportError(ImportError): - pass - -_zip_directory_cache = ... # type: Dict[str, dict] +class ZipImportError(ImportError): ... class zipimporter(object): archive = ... # type: str prefix = ... # type: str - _files = ... # type: Dict[str, tuple] - def __init__(self, path: str) -> None: - raise ZipImportError - def find_module(self, fullname: str, path: str = ...) -> Optional['zipimporter']: ... + def __init__(self, archivepath: str) -> None: ... + def find_module(self, fullname: str, path: str = ...) -> Optional[zipimporter]: ... def get_code(self, fullname: str) -> CodeType: ... - def get_data(self, fullname: str) -> str: - raise IOError + def get_data(self, pathname: str) -> str: ... def get_filename(self, fullname: str) -> str: ... - def get_source(self, fullname: str) -> str: ... + def get_source(self, fullname: str) -> Optional[str]: ... def is_package(self, fullname: str) -> bool: ... def load_module(self, fullname: str) -> ModuleType: ...