mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-01 03:26:52 +00:00
whitelist a bandit false positive and improve type annotation
This commit is contained in:
parent
89b0bb87d7
commit
dcd37ec3d4
2 changed files with 6 additions and 6 deletions
|
|
@ -385,11 +385,11 @@ def token_is_newline(token):
|
|||
|
||||
|
||||
def count_parentheses(current_parentheses_count, token_text):
|
||||
# type: (int, str) -> int
|
||||
"""Count the number of parentheses."""
|
||||
current_parentheses_count = current_parentheses_count or 0
|
||||
if token_text in "([{":
|
||||
if token_text in "([{": # nosec
|
||||
return current_parentheses_count + 1
|
||||
elif token_text in "}])":
|
||||
elif token_text in "}])": # nosec
|
||||
return current_parentheses_count - 1
|
||||
return current_parentheses_count
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue