mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
Python 3.8 support for importlib.resources.files
This commit is contained in:
parent
e6630b59f7
commit
57534facc5
3
setup.py
3
setup.py
@ -32,6 +32,9 @@ VERSION_PY_FILENAME = 'src/allmydata/_version.py'
|
|||||||
version = read_version_py(VERSION_PY_FILENAME)
|
version = read_version_py(VERSION_PY_FILENAME)
|
||||||
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
|
# importlib.resources.files and friends are new in Python 3.9.
|
||||||
|
"importlib_resources; python_version < '3.9'",
|
||||||
|
|
||||||
"zfec >= 1.1.0",
|
"zfec >= 1.1.0",
|
||||||
|
|
||||||
# zope.interface >= 3.6.0 is required for Twisted >= 12.1.0.
|
# zope.interface >= 3.6.0 is required for Twisted >= 12.1.0.
|
||||||
|
@ -4,7 +4,12 @@ Ported to Python 3.
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from six import ensure_str
|
from six import ensure_str
|
||||||
from importlib.resources import files as resource_files, as_file
|
try:
|
||||||
|
from importlib.resources import files as resource_files, as_file
|
||||||
|
except ImportError:
|
||||||
|
import sys
|
||||||
|
assert sys.version_info[:2] < (3, 9)
|
||||||
|
from importlib_resources import files as resource_files, as_file
|
||||||
from contextlib import ExitStack
|
from contextlib import ExitStack
|
||||||
import weakref
|
import weakref
|
||||||
from typing import Optional, Union, TypeVar, overload
|
from typing import Optional, Union, TypeVar, overload
|
||||||
|
Loading…
Reference in New Issue
Block a user