File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 3
3
from PyInstaller import __main__ as pyi_main
4
4
5
5
6
- _APP_SOURCE = """import importlib.resources
6
+ # NOTE: importlib.resources.contents is available in py3.7+, but due to how
7
+ # pyinstaller handles importlib, we need to use the importlib_resources
8
+ # backport if there are any resources methods that are not available in a given
9
+ # python version, which ends up being py<3.10
10
+ _APP_SOURCE = """
11
+ import sys
12
+ if sys.version_info >= (3, 10):
13
+ from importlib.resources import contents
14
+ else:
15
+ from importlib_resources import contents
7
16
8
17
import pydrive2.files
9
18
10
19
11
- cache_files = importlib.resources. contents(
20
+ cache_files = contents(
12
21
"googleapiclient.discovery_cache.documents"
13
22
)
14
23
assert len(cache_files) > 0
Original file line number Diff line number Diff line change 9
9
"flake8-docstrings" ,
10
10
"pytest-mock" ,
11
11
"pyinstaller" ,
12
+ "importlib_resources; python_version < '3.10'" ,
12
13
]
13
14
14
15
tests_requirements .append ("black==22.10.0" )
You can’t perform that action at this time.
0 commit comments