Open
Description
Describe the bug
PR #1189 was introduced in Bandit 1.8.1 which caused a regression found in bug #1216. So the PR was reverted in #1217 so version 1.8.2 could be released without the regression.
So in order to support Python 3.14, #1189 still needs to be reintroduced and also fixing the condition found.
Reproduction steps
1. See #1216 and #1189
Expected behavior
Python 3.14 should pass the build and work with a new testcase similar to the issue found in #1216.
Bandit version
1.8.0 (Default)
Python version
3.13 (Default)
Additional context
No response