From 425500b7baaf4e34958bf477743e01e9bec987a3 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Tue, 28 Apr 2026 17:33:17 +0200 Subject: [PATCH] report: use list comprehension to check for interpreters mypy will complain if `ProblemReport` will get type hints: ``` error: Argument 1 to "filter" has incompatible type "Callable[[Any], bool]"; expected "Callable[[str], TypeGuard[object]]" [arg-type] error: Value of type variable "AnyStr" of "fnmatch" cannot be "object" [type-var] ``` Use a list comprehension instead to make mypy happy and the code more readable. --- apport/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apport/report.py b/apport/report.py index c828c8b63..d3a0046f2 100644 --- a/apport/report.py +++ b/apport/report.py @@ -685,7 +685,7 @@ def _check_interpreted(self) -> None: # check if we consider ExecutablePath an interpreter; we have to do # this, otherwise 'gedit /tmp/foo.txt' would be detected as interpreted # script as well - if not any(filter(lambda i: fnmatch.fnmatch(exebasename, i), interpreters)): + if not any(fnmatch.fnmatch(exebasename, i) for i in interpreters): return # first, determine process name