Ignore warning for pyinstaller dependency search.

This commit is contained in:
Mike Auty
2019-05-06 23:50:36 +01:00
parent f73b2b3e92
commit 1e67ef6a34
2 changed files with 6 additions and 4 deletions
+1 -3
View File
@@ -46,9 +46,7 @@ a = Analysis(['vol.py'],
collect_data_files('volatility.plugins', include_py_files = True),
hiddenimports = collect_submodules('volatility.framework.automagic') + \
collect_submodules('volatility.framework.plugins') + \
collect_submodules('volatility.framework.symbols') + \
collect_submodules('volatility.plugins') + \
collect_submodules('volatility.automagic'),
collect_submodules('volatility.framework.symbols'),
hookspath = [],
runtime_hooks = [],
excludes = [],
+5 -1
View File
@@ -30,7 +30,11 @@ class WarningFindSpec(abc.MetaPathFinder):
def find_spec(fullname: str, path, target = None):
"""Mock find_spec method that just checks the name, this must go first"""
if fullname.startswith("volatility.framework.plugins."):
raise Warning("Please do not use the volatility.framework.plugins namespace, only use volatility.plugins")
warning = "Please do not use the volatility.framework.plugins namespace directly, only use volatility.plugins"
# Pyinstaller uses pkgutil to import, but needs to read the modules to figure out dependencies
# As such, we only print the warning when directly imported rather than being run from a script
if 'pkgutil' not in sys.modules:
raise Warning(warning)
warning_find_spec = [WarningFindSpec()] # type: List[abc.MetaPathFinder]