Wrong line numbers in tracebacks

Patrik Simons <[email protected]> Mon, 15 Jul 2013 14:07:29 +0300
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
I've had some problems with wrong line numbers in tracebacks from ptl
files. Setting lineno for the wrapped function code fixes it:

--- ptl_compile.py.orig	2011-09-28 14:06:08.000000000 +0300
+++ ptl_compile.py	2013-07-15 13:43:08.523463086 +0300
@@ -126,6 +126,7 @@
 
             # wrap original function code
             code = ast.Stmt([assign, code, ret])
+            code.lineno = lineno
 
             if sys.hexversion >= 0x20400a2:
                 n = ast.Function(decorators, name, names, defaults, flags, doc,


-- 
Patrik