mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-12 12:47:39 +02:00
Ignore warning for pyinstaller dependency search.
This commit is contained in:
@@ -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 = [],
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user