summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2003-04-29 17:07:36 (GMT)
committerMichael W. Hudson <mwh@python.net>2003-04-29 17:07:36 (GMT)
commit26848a34d100f5ff9c3f2710d321d68f73204005 (patch)
treee7c2a4244b20e061ed6f871c14c5fafa8648693b /Python
parent58ee2af48ecc353bd56fab588c85248a2f1bc373 (diff)
downloadcpython-26848a34d100f5ff9c3f2710d321d68f73204005.zip
cpython-26848a34d100f5ff9c3f2710d321d68f73204005.tar.gz
cpython-26848a34d100f5ff9c3f2710d321d68f73204005.tar.bz2
Use Tim's suggestion to fix
[ 708901 ] Lineno calculation sometimes broken A one line patch to compile.c and a rather-more-than-one-line patch to test_dis. Hey ho. Possibly a backport candidate -- tho' lnotab is less used in 2.2...
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 57f0edb..a3f48fc 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3366,7 +3366,7 @@ com_for_stmt(struct compiling *c, node *n)
com_node(c, CHILD(n, 3));
com_addbyte(c, GET_ITER);
c->c_begin = c->c_nexti;
- com_set_lineno(c, n->n_lineno);
+ com_set_lineno(c, c->c_last_line);
com_addfwref(c, FOR_ITER, &anchor);
com_push(c, 1);
com_assign(c, CHILD(n, 1), OP_ASSIGN, NULL);