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.

classification
Title: check for return/yield outside function is wrong
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: logistix, nascheme
Priority: normal Keywords:

Created on 2005-04-15 01:53 by nascheme, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg25012 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-04-15 01:53
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.
msg25013 - (view) Author: Grant Olson (logistix) Date: 2005-04-16 22:05
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.
msg25014 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-06-02 05:19
Logged In: YES 
user_id=35752

Fixed by using information about the scope from the symbol
table (newcompile.c 1.1.2.108).
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41858
2005-04-15 01:53:02naschemecreate