This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients benjamin.peterson, ncoghlan, yselivanov
Date 2015-07-22.22:09:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437602957.63.0.089802664911.issue24687@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-07-22 22:09:17yselivanovsetrecipients: + yselivanov, ncoghlan, benjamin.peterson
2015-07-22 22:09:17yselivanovsetmessageid: <1437602957.63.0.089802664911.issue24687@psf.upfronthosting.co.za>
2015-07-22 22:09:17yselivanovlinkissue24687 messages
2015-07-22 22:09:17yselivanovcreate