Skip to content

Commit

Permalink
Suggested small refactors in assignments (#1150)
Browse files Browse the repository at this point in the history
This change makes use of augmented assignment statements as suggested
by issue #760.

Fixes: #760`

Signed-off-by: Eric Brown <eric_wade_brown@yahoo.com>
  • Loading branch information
ericwb authored Jun 23, 2024
1 parent 9e47a90 commit 2b41955
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bandit/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def _get_literal_value(self, literal):
elif isinstance(literal, ast.Tuple):
return_tuple = tuple()
for ti in literal.elts:
return_tuple = return_tuple + (self._get_literal_value(ti),)
return_tuple += (self._get_literal_value(ti),)
literal_value = return_tuple

elif isinstance(literal, ast.Set):
Expand Down
2 changes: 1 addition & 1 deletion bandit/formatters/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def report(manager, fileobj, sev_level, conf_level, lines=-1):
"Test ID: %s Severity: %s Confidence: %s\nCWE: %s\n%s\n"
"Location %s:%s"
)
text = text % (
text %= (
issue.test_id,
issue.severity,
issue.confidence,
Expand Down
2 changes: 1 addition & 1 deletion bandit/plugins/injection_wildcard.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def linux_commands_wildcard_injection(context, config):
argument_string = ""
if isinstance(call_argument, list):
for li in call_argument:
argument_string = argument_string + f" {li}"
argument_string += f" {li}"
elif isinstance(call_argument, str):
argument_string = call_argument

Expand Down

0 comments on commit 2b41955

Please sign in to comment.