Message200936
As a potential fix (albeit an ugly hack), try changing this part of codeop._maybe_compile:
if not code1 and repr(err1) == repr(err2):
raise err1
To something like:
if not code1 and repr(err1) == repr(err2):
if isinstance(err1, SyntaxError) and "no binding for nonlocal" in str(err1) and not source.endswith("\n\n"):
# Allow a nonlocal namebinding to be supplied *after* a
# a function definition (the standard interpreter loop
# handles this by blocking on stdin, but this module accepts
# input as complete strings rather than as a stream)
return None
raise err1 |
|
Date |
User |
Action |
Args |
2013-10-22 12:38:43 | ncoghlan | set | recipients:
+ ncoghlan, terry.reedy, Mark.Shannon, Rosuav, Esa.Peuha |
2013-10-22 12:38:43 | ncoghlan | set | messageid: <1382445523.13.0.876229889389.issue19335@psf.upfronthosting.co.za> |
2013-10-22 12:38:43 | ncoghlan | link | issue19335 messages |
2013-10-22 12:38:42 | ncoghlan | create | |
|