From 61a8641706d32f2b8878b8d138bc7b0d36d0a441 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Thu, 2 Jul 2026 23:47:13 +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 f349f2ca1..e5609f3a6 100644 --- a/apport/report.py +++ b/apport/report.py @@ -670,7 +670,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