|
@ -8,6 +8,7 @@ import pkgutil |
|
|
import posixpath |
|
|
import posixpath |
|
|
import re |
|
|
import re |
|
|
import sys |
|
|
import sys |
|
|
|
|
|
from zipimport import ZipImportError |
|
|
|
|
|
|
|
|
from patacrep import utils |
|
|
from patacrep import utils |
|
|
from patacrep import __DATADIR__ |
|
|
from patacrep import __DATADIR__ |
|
@ -90,6 +91,13 @@ def iter_modules(path, prefix): |
|
|
else: |
|
|
else: |
|
|
try: |
|
|
try: |
|
|
yield module_finder.find_spec(name).loader.load_module() |
|
|
yield module_finder.find_spec(name).loader.load_module() |
|
|
|
|
|
except AttributeError: |
|
|
|
|
|
# It is a zipimport.zipimporter object |
|
|
|
|
|
try: |
|
|
|
|
|
yield module_finder.load_module(name) |
|
|
|
|
|
except ZipImportError as error: |
|
|
|
|
|
LOGGER.debug("[plugins] Could not load module {}: {}".format(name, str(error))) |
|
|
|
|
|
continue |
|
|
except ImportError as error: |
|
|
except ImportError as error: |
|
|
LOGGER.debug("[plugins] Could not load module {}: {}".format(name, str(error))) |
|
|
LOGGER.debug("[plugins] Could not load module {}: {}".format(name, str(error))) |
|
|
continue |
|
|
continue |
|
|