From c7d3de8bf8a16113a122c9a30597c46b00dd2360 Mon Sep 17 00:00:00 2001 From: Willi Ballenthin Date: Wed, 22 Apr 2026 09:44:23 +0300 Subject: [PATCH] fix: base_extractor.py: __metaclass__ is Python 2 syntax, ignored in Py3 Closes #3024 --- CHANGELOG.md | 2 ++ capa/features/extractors/base_extractor.py | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55ecd174..1f6ac984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,8 @@ - fix: elffile.py: get_base_address returns None instead of NO_ADDRESS @williballenthin #3023 +- fix: base_extractor.py: __metaclass__ is Python 2 syntax, ignored in Py3 @williballenthin #3024 + ### capa Explorer Web ### capa Explorer IDA Pro plugin diff --git a/capa/features/extractors/base_extractor.py b/capa/features/extractors/base_extractor.py index b5f88018..704301eb 100644 --- a/capa/features/extractors/base_extractor.py +++ b/capa/features/extractors/base_extractor.py @@ -91,7 +91,7 @@ class InsnHandle: inner: Any -class StaticFeatureExtractor: +class StaticFeatureExtractor(abc.ABC): """ StaticFeatureExtractor defines the interface for fetching features from a sample without running it; extractors that rely on the execution trace of @@ -109,8 +109,6 @@ class StaticFeatureExtractor: This class is not instantiated directly; it is the base class for other implementations. """ - __metaclass__ = abc.ABCMeta - def __init__(self, hashes: SampleHashes): # # note: a subclass should define ctor parameters for its own use. @@ -359,7 +357,7 @@ class CallHandle: inner: Any -class DynamicFeatureExtractor: +class DynamicFeatureExtractor(abc.ABC): """ DynamicFeatureExtractor defines the interface for fetching features from a sandbox' analysis of a sample; extractors that rely on statically analyzing @@ -372,8 +370,6 @@ class DynamicFeatureExtractor: This class is not instantiated directly; it is the base class for other implementations. """ - __metaclass__ = abc.ABCMeta - def __init__(self, hashes: SampleHashes): # # note: a subclass should define ctor parameters for its own use.