Merge pull request #378 from dkw72n/wrong_type

Fix #377
This commit is contained in:
R. Bernstein 2021-12-31 11:07:14 -05:00 committed by GitHub
commit 9172f82bae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -293,7 +293,7 @@ class TreeTransform(GenericASTTraversal, object):
else_suite_index = 1
len_n = len(n)
if len_n == 1 == len(n[0]) and n[0] == "stmt":
if len_n == 1 and type(n[0]) is SyntaxTree and len(n[0]) == 1 and n[0] == "stmt":
n = n[0][0]
elif len_n == 0:
return node