From b76629687120cd5403944d8c2a63a3d1bd6b4097 Mon Sep 17 00:00:00 2001 From: mr-tz Date: Tue, 1 Oct 2024 17:00:22 +0000 Subject: [PATCH] add Python 3.8 and 3.9 deprecation warning --- capa/ghidra/capa_explorer.py | 2 ++ capa/ghidra/capa_ghidra.py | 2 ++ capa/main.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/capa/ghidra/capa_explorer.py b/capa/ghidra/capa_explorer.py index e0b2cf19a..ddc5ad08b 100644 --- a/capa/ghidra/capa_explorer.py +++ b/capa/ghidra/capa_explorer.py @@ -372,6 +372,8 @@ def main(): from capa.exceptions import UnsupportedRuntimeError raise UnsupportedRuntimeError("This version of capa can only be used with Python 3.8+") + elif sys.version_info < (3, 10): + raise DeprecationWarning("This is the last capa version supporting Python 3.8 and 3.9.") exit_code = main() if exit_code != 0: popup("capa explorer encountered errors during analysis. Please check the console output for more information.") # type: ignore [name-defined] # noqa: F821 diff --git a/capa/ghidra/capa_ghidra.py b/capa/ghidra/capa_ghidra.py index 55ab8046e..1030d3ea6 100644 --- a/capa/ghidra/capa_ghidra.py +++ b/capa/ghidra/capa_ghidra.py @@ -164,4 +164,6 @@ def main(): from capa.exceptions import UnsupportedRuntimeError raise UnsupportedRuntimeError("This version of capa can only be used with Python 3.8+") + elif sys.version_info < (3, 10): + raise DeprecationWarning("This is the last capa version supporting Python 3.8 and 3.9.") sys.exit(main()) diff --git a/capa/main.py b/capa/main.py index 518c9ce26..85165fda5 100644 --- a/capa/main.py +++ b/capa/main.py @@ -903,6 +903,8 @@ def apply_extractor_filters(extractor: FeatureExtractor, extractor_filters: Filt def main(argv: Optional[List[str]] = None): if sys.version_info < (3, 8): raise UnsupportedRuntimeError("This version of capa can only be used with Python 3.8+") + elif sys.version_info < (3, 10): + raise DeprecationWarning("This is the last capa version supporting Python 3.8 and 3.9.") if argv is None: argv = sys.argv[1:]