mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-09 19:27:39 +02:00
Fix up typing for the import warning spec.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
"""Volatility 3 - An open-source memory forensics framework"""
|
||||
import sys
|
||||
from importlib import abc
|
||||
from typing import List
|
||||
|
||||
|
||||
class WarningFindSpec(abc.MetaPathFinder):
|
||||
@@ -32,8 +33,8 @@ class WarningFindSpec(abc.MetaPathFinder):
|
||||
raise Warning("Please do not use the volatility.framework.plugins namespace, only use volatility.plugins")
|
||||
|
||||
|
||||
if WarningFindSpec not in sys.meta_path:
|
||||
sys.meta_path = [WarningFindSpec] + sys.meta_path
|
||||
warning_find_spec = [WarningFindSpec()] # type: List[abc.MetaPathFinder]
|
||||
sys.meta_path = warning_find_spec + sys.meta_path
|
||||
|
||||
# We point the volatility.plugins __path__ variable at BOTH
|
||||
# volatility/plugins
|
||||
|
||||
Reference in New Issue
Block a user