diff --git a/edk2toolext/edk2_invocable.py b/edk2toolext/edk2_invocable.py index 36fd5bda..41e3b2f2 100644 --- a/edk2toolext/edk2_invocable.py +++ b/edk2toolext/edk2_invocable.py @@ -21,6 +21,7 @@ import logging import os import sys +import warnings from random import choice from string import ascii_letters from textwrap import dedent @@ -391,6 +392,9 @@ def ParseCommandLineOptions(self): print(e) sys.exit(2) + # Turn on Deprecation warnings for code in the module + warnings.filterwarnings("default", category=DeprecationWarning, module=self.PlatformModule.__name__) + # instantiate the second argparser that will get passed around parserObj = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,) diff --git a/edk2toolext/environment/plugin_manager.py b/edk2toolext/environment/plugin_manager.py index ffb2c5a1..a016c7d7 100644 --- a/edk2toolext/environment/plugin_manager.py +++ b/edk2toolext/environment/plugin_manager.py @@ -11,6 +11,7 @@ import logging import os import sys +import warnings from edk2toolext.environment import shell_environment @@ -101,6 +102,9 @@ def _load(self, PluginDescriptor): if py_module_dir not in sys.path: sys.path.append(py_module_dir) + # Turn on Deprecation warnings for code in the plugin + warnings.filterwarnings("default", category=DeprecationWarning, module=module.__name__) + spec.loader.exec_module(module) except Exception: exc_info = sys.exc_info()