Skip to content

Commit

Permalink
where does simplification stop and where does code golfing start ?
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Sep 12, 2021
1 parent c0c37a0 commit 4753f82
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pyupgrade/_plugins/versioned_branches.py
Expand Up @@ -176,11 +176,10 @@ def visit_If(
) and
len(node.test.ops) == 1 and (
_eq(node.test, 3) or
_compare_to_3(node.test, (ast.Gt, ast.GtE)) or
_compare_to_3(node.test, ast.GtE, min_version[1]) or
any(
_compare_to_3(node.test, (ast.Gt, ast.GtE), minor)
for minor in range(min_version[1])
for minor in range(max(min_version[1], 1))
)
)
)
Expand Down

0 comments on commit 4753f82

Please sign in to comment.