[ python-Bugs-1183468 ] check for return/yield outside function is wrong

SourceForge.net noreply at sourceforge.net
Thu Jun 2 07:19:22 CEST 2005


Bugs item #1183468, was opened at 2005-04-15 01:53
Message generated for change (Comment added) made by nascheme
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1183468&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser/Compiler
Group: AST
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Neil Schemenauer (nascheme)
Assigned to: Nobody/Anonymous (nobody)
Summary: check for return/yield outside function is wrong

Initial Comment:
The code currently uses c_nestlevel.  That's incorrect
as this example code demonstrates:

>>> class A:
...     return
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Error when calling the metaclass bases
    PyClass_New: dict must be a dictionary

Not sure what the fix is but I wanted to file a bug so
it doesn't get forgotten.

----------------------------------------------------------------------

>Comment By: Neil Schemenauer (nascheme)
Date: 2005-06-02 05:19

Message:
Logged In: YES 
user_id=35752

Fixed by using information about the scope from the symbol
table (newcompile.c 1.1.2.108).

----------------------------------------------------------------------

Comment By: logistix (logistix)
Date: 2005-04-16 22:05

Message:
Logged In: YES 
user_id=699438

Patch 1184418 is (sortof) posted.  SF is giving me grief when 
I try to do it as a real attachment though.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1183468&group_id=5470


More information about the Python-bugs-list mailing list