Update importlib-resources==5.4.0

This commit is contained in:
JonnyWong16 2021-11-28 13:54:44 -08:00
parent c79c48fcca
commit 563f697563
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
12 changed files with 167 additions and 125 deletions

View file

@ -6,13 +6,12 @@ import contextlib
import types
import importlib
from typing import Union, Any, Optional
from typing import Union, Optional
from .abc import ResourceReader, Traversable
from ._compat import wrap_spec
Package = Union[types.ModuleType, str]
Resource = Union[str, os.PathLike]
def files(package):
@ -23,19 +22,6 @@ def files(package):
return from_package(get_package(package))
def normalize_path(path):
# type: (Any) -> str
"""Normalize a path by ensuring it is a string.
If the resulting string contains path separators, an exception is raised.
"""
str_path = str(path)
parent, file_name = os.path.split(str_path)
if parent:
raise ValueError(f'{path!r} must be only a file name')
return file_name
def get_resource_reader(package):
# type: (types.ModuleType) -> Optional[ResourceReader]
"""