Merge branch 'develop' into dist/risotto/risotto-2.8.0/develop

This commit is contained in:
Emmanuel Garette 2021-04-12 16:58:05 +02:00
commit 4fd5d38ca0

View File

@ -26,12 +26,27 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from .variable import CONVERT_OPTION from .variable import CONVERT_OPTION
import importlib.resources import importlib.resources
from os.path import dirname, join
from ..utils import load_modules from ..utils import load_modules
ANNOTATORS = None ANNOTATORS = None
if not 'files' in dir(importlib.resources):
# old python version
class fake_files:
def __init__(self, package):
self.mod = []
dir_package = dirname(importlib.resources._get_package(package).__file__)
for mod in importlib.resources.contents(package):
self.mod.append(join(dir_package, mod))
def iterdir(self):
return self.mod
importlib.resources.files = fake_files
def get_level(module): def get_level(module):
return module.level return module.level