From db3c120aa773aef4762f49b4ae4fc77215a288d6 Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Fri, 5 Apr 2019 14:53:41 +0100 Subject: [PATCH] Fix up typing for the import warning spec. --- volatility/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/volatility/__init__.py b/volatility/__init__.py index 52ece080b..dcadc9950 100644 --- a/volatility/__init__.py +++ b/volatility/__init__.py @@ -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