Author: Tobias Pape <tob...@netshed.de> Branch: Changeset: r70325:33a9aeb0b05e Date: 2014-03-29 12:47 +0100 http://bitbucket.org/pypy/pypy/changeset/33a9aeb0b05e/
Log: Be a bit more narrative about what can create a closure diff --git a/rpython/flowspace/objspace.py b/rpython/flowspace/objspace.py --- a/rpython/flowspace/objspace.py +++ b/rpython/flowspace/objspace.py @@ -16,7 +16,13 @@ if func.func_doc and func.func_doc.lstrip().startswith('NOT_RPYTHON'): raise ValueError("%r is tagged as NOT_RPYTHON" % (func,)) if func.func_code.co_cellvars: - raise ValueError("RPython functions cannot create closures") + raise ValueError( +"""RPython functions cannot create closures +Possible casues: + Function is inner function + Function uses generator expressions + Lambda expressions +""") if not (func.func_code.co_flags & CO_NEWLOCALS): raise ValueError("The code object for a RPython function should have " "the flag CO_NEWLOCALS set.") _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit