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
  • Loading branch information
mr-tz committed Oct 1, 2024
1 parent 3e8bed1 commit b766296
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions capa/ghidra/capa_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions capa/ghidra/capa_ghidra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
2 changes: 2 additions & 0 deletions capa/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:]
Expand Down

0 comments on commit b766296

Please sign in to comment.