summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-02-04 23:51:55 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-02-04 23:51:55 +0000
commit681a2150e3acb0e892e3a8bf527bbd4fe1769ca1 (patch)
tree3f7604f2fde43df703abcd0437f346a4ec5213d0 /Python
parent35d55c2a84f7e0ba4925d26139578c9b5b131b57 (diff)
downloadcpython-681a2150e3acb0e892e3a8bf527bbd4fe1769ca1.tar.gz
No need to emit co_lnotab item when both offsets are zeros.
r60579 broke a test test_compile, which seems to test an "implementation detail" IMO. Also test that this correction does not impact the debugger.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 6df09dc53c..4dfc42d928 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -4191,6 +4191,9 @@ assemble_lnotab(struct assembler *a, struct instr *i)
assert(d_bytecode >= 0);
assert(d_lineno >= 0);
+ if(d_bytecode == 0 && d_lineno == 0)
+ return 1;
+
if (d_bytecode > 255) {
int j, nbytes, ncodes = d_bytecode / 255;
nbytes = a->a_lnotab_off + 2 * ncodes;