cfg.py: restore importlib_resources import (pylint bug workaround)

This commit is contained in:
The MMGen Project 2024-02-15 09:28:07 +00:00
commit ee932a40bc
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 7 additions and 2 deletions

View file

@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python-version: ["3.10","3.11"]
python-version: ["3.9","3.10","3.11"]
steps:
- uses: actions/checkout@v4

View file

@ -75,7 +75,12 @@ class GlobalConstants(Lockable):
# Resource Access without the performance overhead of that package.
# https://importlib-resources.readthedocs.io/en/latest/migration.html
# https://setuptools.readthedocs.io/en/latest/pkg_resources.html
from importlib.resources import files
# TODO: remove try..except (workaround for Python 3.9 pylint bug)
try:
from importlib.resources import files # Python 3.9 and above
except ImportError:
from importlib_resources import files
return files(package).joinpath('data',filename).read_text()
@property