mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-06 05:01:14 -07:00
Update importlib-resources==5.4.0
This commit is contained in:
parent
c79c48fcca
commit
563f697563
12 changed files with 167 additions and 125 deletions
|
@ -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]
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue