From 4753f827f857c4805a1a38442631168dc4d49930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sun, 12 Sep 2021 14:42:01 +0200 Subject: [PATCH] where does simplification stop and where does code golfing start ? --- pyupgrade/_plugins/versioned_branches.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyupgrade/_plugins/versioned_branches.py b/pyupgrade/_plugins/versioned_branches.py index 6cc7a1c4..9f38e07c 100644 --- a/pyupgrade/_plugins/versioned_branches.py +++ b/pyupgrade/_plugins/versioned_branches.py @@ -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)) ) ) )