Add back module-level __getattr__ to encodings (#5261)

This is needed for submodules, such as `encodings.cp437`.
This commit is contained in:
Jukka Lehtosalo
2021-04-28 15:45:15 +01:00
committed by GitHub
parent 2c8cb60596
commit 8bd3e16eef
2 changed files with 6 additions and 2 deletions

View File

@@ -1,7 +1,10 @@
from codecs import CodecInfo
from typing import Optional, Union
from typing import Any, Optional, Union
class CodecRegistryError(LookupError, SystemError): ...
def normalize_encoding(encoding: Union[str, bytes]) -> str: ...
def search_function(encoding: str) -> Optional[CodecInfo]: ...
# Needed for submodules
def __getattr__(name: str) -> Any: ... # incomplete