Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3ebc1f

Browse files
committed
Merged revisions 76423-76424 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r76423 | benjamin.peterson | 2009-11-19 19:15:53 -0600 (Thu, 19 Nov 2009) | 1 line provide line number for lambdas ........ r76424 | benjamin.peterson | 2009-11-19 19:16:58 -0600 (Thu, 19 Nov 2009) | 1 line genexps have linenos ........
1 parent 4f879e7 commit f3ebc1f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Python/symtable.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,9 +1323,8 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
13231323
return 0;
13241324
if (e->v.Lambda.args->defaults)
13251325
VISIT_SEQ(st, expr, e->v.Lambda.args->defaults);
1326-
/* XXX how to get line numbers for expressions */
13271326
if (!symtable_enter_block(st, lambda,
1328-
FunctionBlock, (void *)e, 0))
1327+
FunctionBlock, (void *)e, e->lineno))
13291328
return 0;
13301329
VISIT_IN_BLOCK(st, arguments, e->v.Lambda.args, (void*)e);
13311330
VISIT_IN_BLOCK(st, expr, e->v.Lambda.body, (void*)e);
@@ -1623,7 +1622,7 @@ symtable_handle_comprehension(struct symtable *st, expr_ty e,
16231622
VISIT(st, expr, outermost->iter);
16241623
/* Create comprehension scope for the rest */
16251624
if (!scope_name ||
1626-
!symtable_enter_block(st, scope_name, FunctionBlock, (void *)e, 0)) {
1625+
!symtable_enter_block(st, scope_name, FunctionBlock, (void *)e, e->lineno)) {
16271626
return 0;
16281627
}
16291628
st->st_cur->ste_generator = is_generator;

0 commit comments

Comments
 (0)