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
refleak on SyntaxError in function parameter annotation #68875
Comments
A simple way of reproducing the issue is to try to compile the following piece of code with refleaks check mode on: def foo(a:(yield)): pass Since '(yield)' expression is outside of a function, it will trigger a SyntaxError. There is a subtle bug in compile.c though, specifically in compiler_visit_argannotation method; it should return -1 in case of error, but the VISIT macro it uses returns 0 on errors. Attached patch uses 'compiler_visit_expr' directly returning correct error code. |
I would prefer that compiler_visit_argannotation[s] be fixed to use the normal calling convention. |
Agree, new patch attached. |
Seems fine to me. |
New changeset b5a7f529b4ac by Yury Selivanov in branch '3.5': New changeset cf91ae981afd by Yury Selivanov in branch 'default': |
Thanks, Benjamin! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: