Skip to content

Commit

Permalink
simplify #112 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jan 20, 2022
1 parent 0a1c07a commit 6130fe2
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions pyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("()")

Expand Down

0 comments on commit 6130fe2

Please sign in to comment.