Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(250029)

Unified Diff: Python/symtable.c

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Objects/exceptions.c ('K') | « Python/Python-ast.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Python/symtable.c Thu Jan 12 08:06:49 2012 +0100
+++ b/Python/symtable.c Fri Jan 13 00:26:31 2012 +1000
@@ -19,10 +19,6 @@
#define IMPORT_STAR_WARNING "import * only allowed at module level"
-#define RETURN_VAL_IN_GENERATOR \
- "'return' with argument inside generator"
-
-
static PySTEntryObject *
ste_new(struct symtable *st, identifier name, _Py_block_ty block,
void *key, int lineno, int col_offset)
@@ -1133,14 +1129,6 @@
if (s->v.Return.value) {
VISIT(st, expr, s->v.Return.value);
st->st_cur->ste_returns_value = 1;
- if (st->st_cur->ste_generator) {
- PyErr_SetString(PyExc_SyntaxError,
- RETURN_VAL_IN_GENERATOR);
- PyErr_SyntaxLocationEx(st->st_filename,
- s->lineno,
- s->col_offset);
- return 0;
- }
}
break;
case Delete_kind:
@@ -1345,13 +1333,6 @@
if (e->v.Yield.value)
VISIT(st, expr, e->v.Yield.value);
st->st_cur->ste_generator = 1;
- if (st->st_cur->ste_returns_value) {
- PyErr_SetString(PyExc_SyntaxError,
- RETURN_VAL_IN_GENERATOR);
- PyErr_SyntaxLocationEx(st->st_filename,
- e->lineno, e->col_offset);
- return 0;
- }
break;
case Compare_kind:
VISIT(st, expr, e->v.Compare.left);
« Objects/exceptions.c ('K') | « Python/Python-ast.c ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+