1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 09:18:08 +00:00

Merge pull request #2290 from GNS3/fix/2147

Fix issue when using importlib.resources.files()
This commit is contained in:
Jeremy Grossmann 2023-09-23 20:54:57 +10:00 committed by GitHub
commit 6886f1f566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ class Controller:
if not os.path.exists(os.path.join(dst_path, filename)):
shutil.copy(os.path.join(resource_path, filename), os.path.join(dst_path, filename))
else:
for entry in importlib_resources.files(f'gns3server.{resource_name}').iterdir():
for entry in importlib_resources.files('gns3server').joinpath(resource_name).iterdir():
full_path = os.path.join(dst_path, entry.name)
if entry.is_file() and not os.path.exists(full_path):
log.debug(f'Installing {resource_name} resource file "{entry.name}" to "{full_path}"')

View File

@ -12,7 +12,7 @@ async-timeout>=4.0.2,<4.1
distro>=1.8.0
py-cpuinfo>=9.0.0,<10.0
platformdirs>=2.4.0
importlib-resources>=1.3; python_version <= '3.9'
importlib-resources>=1.3; python_version < '3.9'
truststore>=0.8.0; python_version >= '3.10'
setuptools>=60.8.1; python_version >= '3.7'
setuptools==59.6.0; python_version < '3.7' # v59.6.0 is the last version to support Python 3.6