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
commitbc212104e48eaaf2038c0a3f9dc2e1304a039a8b (patch)
tree20e3fdcc6af9daaf53d3169fdb0bad22612f9a66 /Python
parentdcf84003c18ccd6e7ccf176dab069b1900bb651c (diff)
downloadcpython-git-bc212104e48eaaf2038c0a3f9dc2e1304a039a8b.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;