From 6130fe211243e9e674e8fef2c2a71ae519f81635 Mon Sep 17 00:00:00 2001 From: Akuli Date: Thu, 20 Jan 2022 21:51:25 +0200 Subject: [PATCH] simplify #112 stuff --- pyi.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pyi.py b/pyi.py index acf5e962..5f38724a 100644 --- a/pyi.py +++ b/pyi.py @@ -461,15 +461,10 @@ def _check_for_multiple_literals(self, members: Sequence[ast.expr]) -> None: new_literal_members: list[ast.expr] = [] for literal in literals_in_union: - if sys.version_info >= (3, 9): - contents = literal + if isinstance(literal, ast.Tuple): + new_literal_members.extend(literal.elts) else: - contents = literal.value - - if isinstance(contents, ast.Tuple): - new_literal_members.extend(contents.elts) - else: - new_literal_members.append(contents) + new_literal_members.append(literal) new_literal_slice = unparse(ast.Tuple(new_literal_members)).strip("()")