-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to recognize nested try: #23
Comments
Hmm, actually it seems this is an issue in 2.7.6 as well. Thanks for reporting! |
Aye, this is a difficult case because these two parse to the same ast: try:
try:
a
except:
b
finally:
c and try:
a
except:
b
finally:
c Both result in: The extra desugaring throws off the annotator. |
Hmm should we commit to supporting cases like this? It is a bit weird to respect it since the ast doesn't really respect this pattern (which I assume is because these two forms are semantically equivalent anyway). |
Hi @soupytwist I tested here your last commit with the following file and everything was ok:
But, when I commented the file: test.py
Running the file to show that it's a valid syntax =)
Running the parse on this test.py file:
cc @nicoddemus |
re: @akov It's legal python, and by principle #1, we need to be able to output exactly as it is read in. I plan to support it. @williamjamir Thanks for the follow-up! Will work on fixing this. |
Hi,
Running the parser against a file with "nested try" results in the following error:
I found this issue with
(In python 3.4.5 works just fine)
Test.py
Script.py:
Full Log:
The text was updated successfully, but these errors were encountered: