This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 167956 - org.python.antlr.ParseException: 'return' with argument inside generator
Summary: org.python.antlr.ParseException: 'return' with argument inside generator
Status: VERIFIED FIXED
Alias: None
Product: python
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jenselme
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-01 13:03 UTC by Exceptions Reporter
Modified: 2015-11-27 22:24 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 145006


Attachments
stacktrace (2.49 KB, text/plain)
2009-07-01 13:03 UTC, Exceptions Reporter
Details
stacktrace (2.56 KB, text/plain)
2009-12-20 10:47 UTC, schkovich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2009-07-01 13:03:49 UTC
Build: NetBeans IDE 6.5 (Build 200811131701)
VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Windows XP, 5.1, x86

User Comments:
rudysplif: see: 181294, 181299

it seems to happen when I hit anything, this time I was clicking on the 'save all files' icon in the toolbar

jsober: Changing a standard function to a Python generator.  I had not yet removed the return statement, but had added a yield statement.

rudysplif: netbeans has been open for about 8 hours, previously with no issue, now any key I type I get this error

piastucki: editing Python code



Stacktrace: 
org.python.antlr.ParseException: 'return' with argument inside generator
        at org.netbeans.modules.python.editor.scopes.ScopeInfo.noteReturnValue(ScopeInfo.java:421)
        at org.netbeans.modules.python.editor.scopes.ScopesCompiler.visitReturn(ScopesCompiler.java:526)
        at org.python.antlr.ast.Return.accept(Return.java:46)
        at org.python.antlr.Visitor.visit(Visitor.java:26)
        at org.netbeans.modules.python.editor.scopes.ScopesCompiler.suite(ScopesCompiler.java:325)
        at org.netbeans.modules.python.editor.scopes.ScopesCompiler.visitFunctionDef(ScopesCompiler.java:292)
Comment 1 Exceptions Reporter 2009-07-01 13:03:58 UTC
Created attachment 84241 [details]
stacktrace
Comment 2 Exceptions Reporter 2009-07-01 13:04:14 UTC
This issue already has 6 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=145006
Comment 3 schkovich 2009-12-20 10:47:50 UTC
Created attachment 92794 [details]
stacktrace

My first encounter with Python did not went that well. ;)

Exception was rased after pasting line of code.
Comment 4 Jenselme 2015-10-02 16:12:18 UTC
changeset:   18335:9fcb8370996a
bookmark:    main
tag:         tip
user:        Julien Enselme <jenselme@netbeans.org>
date:        Fri Oct 02 18:11:04 2015 +0200
files:       python.source/src/org/netbeans/modules/python/source/scopes/ScopesCompiler.java python.source/src/org/netbeans/modules/python/source/scopes/SymbolTable.java
description:
#167956 org.python.antlr.ParseException: 'return' with argument inside generator

Catch the exception and report it as an error hint to the user.


Downgrading priority to P4. This should be close with the next release of nbpython.
Comment 5 Jenselme 2015-11-27 16:50:50 UTC
Presumed fixed in Python .151118 (for IDE 8.1)