Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Sep 13, 2021
1 parent 20ad994 commit c213c31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyupgrade/_plugins/versioned_branches.py
Expand Up @@ -188,5 +188,10 @@ def visit_If(
):
if node.orelse and not isinstance(node.orelse[0], ast.If):
yield ast_to_offset(node), _fix_py3_block_else
elif not node.orelse:
elif not node.orelse and min_version == (3, 0):
# allow >= (3,) and > (3,) to be dedent even without
# an else clause, as a special cases
yield ast_to_offset(node), _fix_py3_block
else:
# don't try to fix, e.g., >= (3, 6) if there's no else clause
yield ast_to_offset(node), lambda i, tokens: None

0 comments on commit c213c31

Please sign in to comment.