From 8b367c770b14f95dcd8bf43c95758270c4116c7c Mon Sep 17 00:00:00 2001 From: Josh Staiger Date: Sun, 5 Nov 2017 14:00:51 -0800 Subject: [PATCH] Make pkgutil.get_data return Optional[bytes] (#1714) As per the docs (and implementation): - https://docs.python.org/3/library/pkgutil.html#pkgutil.get_data If the package cannot be located or loaded ... then None is returned. --- stdlib/2and3/pkgutil.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2and3/pkgutil.pyi b/stdlib/2and3/pkgutil.pyi index e6d467245..88461524a 100644 --- a/stdlib/2and3/pkgutil.pyi +++ b/stdlib/2and3/pkgutil.pyi @@ -28,4 +28,4 @@ def iter_modules(path: Optional[List[str]] = ..., prefix: str = ...) -> _YMFNI: ... # TODO precise type def walk_packages(path: Optional[str] = ..., prefix: str = ..., onerror: Optional[Callable[[str], None]] = ...) -> _YMFNI: ... -def get_data(package: str, resource: str) -> bytes: ... +def get_data(package: str, resource: str) -> Optional[bytes]: ...