Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#997)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/pyupgrade: v2.16.0 → v2.18.2](asottile/pyupgrade@v2.16.0...v2.18.2)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] committed May 24, 2021
1 parent f6ab109 commit e9ec079
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -22,7 +22,7 @@ repos:
hooks:
- id: black-disable-checker
- repo: https://github.com/asottile/pyupgrade
rev: v2.16.0
rev: v2.18.2
hooks:
- id: pyupgrade
exclude: tests/testdata
Expand Down
6 changes: 2 additions & 4 deletions astroid/as_string.py
Expand Up @@ -184,10 +184,8 @@ def visit_classdef(self, node):
def visit_compare(self, node):
"""return an astroid.Compare node as string"""
rhs_str = " ".join(
[
f"{op} {self._precedence_parens(node, expr, is_left=False)}"
for op, expr in node.ops
]
f"{op} {self._precedence_parens(node, expr, is_left=False)}"
for op, expr in node.ops
)
return f"{self._precedence_parens(node, node.left)} {rhs_str}"

Expand Down
2 changes: 1 addition & 1 deletion tests/unittest_builder.py
Expand Up @@ -572,7 +572,7 @@ def func():
return 'None'
"""
astroid = builder.parse(code)
none, nothing, chain = [ret.value for ret in astroid.body[0].body]
none, nothing, chain = (ret.value for ret in astroid.body[0].body)
self.assertIsInstance(none, nodes.Const)
self.assertIsNone(none.value)
self.assertIsNone(nothing)
Expand Down

0 comments on commit e9ec079

Please sign in to comment.