cfg.py: restore importlib_resources import (pylint bug workaround)
This commit is contained in:
parent
47913e6e7a
commit
ee932a40bc
2 changed files with 7 additions and 2 deletions
2
.github/workflows/pylint.yaml
vendored
2
.github/workflows/pylint.yaml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue