Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 45158:0dfaa92bd534 2.5
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.
| author | Amaury Forgeot d'Arc <amauryfa@gmail.com> |
|---|---|
| date | Mon, 04 Feb 2008 23:51:55 +0000 |
| parents | 86602b603462 |
| children | 8cbe0bd93c28 |
line wrap: on
line diff
--- a/Python/compile.c Mon Feb 04 23:41:02 2008 +0000 +++ b/Python/compile.c Mon Feb 04 23:51:55 2008 +0000 @@ -4191,6 +4191,9 @@ 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;
