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.
This commit is contained in:
Josh Staiger
2017-11-05 14:00:51 -08:00
committed by Jelle Zijlstra
parent bc2f88d6ee
commit 8b367c770b

View File

@@ -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]: ...