Skip to content

Commit

Permalink
add Python 3.8 and 3.9 deprecation warning
Browse files Browse the repository at this point in the history
tmp
  • Loading branch information
mr-tz committed Oct 1, 2024
1 parent 3e8bed1 commit 9cac15b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions capa/ghidra/capa_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@ 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):
from warnings import warn

warn("This is the last capa version supporting Python 3.8 and 3.9.", DeprecationWarning, stacklevel=2)
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
Expand Down
4 changes: 4 additions & 0 deletions capa/ghidra/capa_ghidra.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,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):
from warnings import warn

warn("This is the last capa version supporting Python 3.8 and 3.9.", DeprecationWarning, stacklevel=2)
sys.exit(main())
4 changes: 4 additions & 0 deletions capa/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,10 @@ 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):
from warnings import warn

warn("This is the last capa version supporting Python 3.8 and 3.9.", DeprecationWarning, stacklevel=2)

if argv is None:
argv = sys.argv[1:]
Expand Down

0 comments on commit 9cac15b

Please sign in to comment.