From 9b42b45d2140b9b645c63e2209aaada5962f6f34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 10:19:16 -0700 Subject: [PATCH] build(deps-dev): bump flake8-bugbear from 24.12.12 to 25.10.21 (#2773) * build(deps-dev): bump flake8-bugbear from 24.12.12 to 25.10.21 Bumps [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) from 24.12.12 to 25.10.21. - [Release notes](https://github.com/PyCQA/flake8-bugbear/releases) - [Commits](https://github.com/PyCQA/flake8-bugbear/compare/24.12.12...25.10.21) --- updated-dependencies: - dependency-name: flake8-bugbear dependency-version: 25.10.21 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * fix flake8 raised bugs * use super --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mr-tz Co-authored-by: Moritz --- capa/main.py | 1 + capa/rules/__init__.py | 15 +++------------ pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/capa/main.py b/capa/main.py index 3e4af74e..fc932576 100644 --- a/capa/main.py +++ b/capa/main.py @@ -392,6 +392,7 @@ class ShouldExitError(Exception): """raised when a main-related routine indicates the program should exit.""" def __init__(self, status_code: int): + super().__init__(status_code) self.status_code = status_code diff --git a/capa/rules/__init__.py b/capa/rules/__init__.py index b5a0911b..da0a7d03 100644 --- a/capa/rules/__init__.py +++ b/capa/rules/__init__.py @@ -274,12 +274,8 @@ SUPPORTED_FEATURES[Scope.FUNCTION].update(SUPPORTED_FEATURES[Scope.BASIC_BLOCK]) class InvalidRule(ValueError): - def __init__(self, msg): - super().__init__() - self.msg = msg - def __str__(self): - return f"invalid rule: {self.msg}" + return f"invalid rule: {super().__str__()}" def __repr__(self): return str(self) @@ -289,20 +285,15 @@ class InvalidRuleWithPath(InvalidRule): def __init__(self, path, msg): super().__init__(msg) self.path = path - self.msg = msg self.__cause__ = None def __str__(self): - return f"invalid rule: {self.path}: {self.msg}" + return f"invalid rule: {self.path}: {super(InvalidRule, self).__str__()}" class InvalidRuleSet(ValueError): - def __init__(self, msg): - super().__init__() - self.msg = msg - def __str__(self): - return f"invalid rule set: {self.msg}" + return f"invalid rule set: {super().__str__()}" def __repr__(self): return str(self) diff --git a/pyproject.toml b/pyproject.toml index a655ca6f..9052142d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,7 +127,7 @@ dev = [ "pytest-sugar==1.1.1", "pytest-instafail==0.5.0", "flake8==7.3.0", - "flake8-bugbear==24.12.12", + "flake8-bugbear==25.10.21", "flake8-encodings==0.5.1", "flake8-comprehensions==3.17.0", "flake8-logging-format==0.9.0",