Re: incorrect line reported in traceback
- From: "Patrick Stinson" <patrickstinson.lists@xxxxxxxxx>
- Date: Sun, 30 Nov 2008 21:05:35 -0900
No, I've embedded the interpreter and an editor in my app, which might
have something to do with it. I can't run the scripts at the command
line because my app provides an API to built-ins that isn't availbel
in the standard interpreter. I am simply calling a python method in
the script module using PyObject_CallObject(), and fetching the
traceback using PyErr_Fetch() and PyErr_Normalize(), like this:
PyObject *type, *value, *traceback;
PyErr_Fetch(&type, &value, &traceback);
PyErr_NormalizeException(&type, &value, &traceback);
if(traceback) // traceback.tb_lineno
*lineno = ((PyTracebackObject *) traceback)->tb_lineno;
On Sun, Nov 30, 2008 at 8:59 PM, John Machin <sjmachin@xxxxxxxxxxx> wrote:
On Dec 1, 4:47 pm, "Patrick Stinson" <patrickstinson.li...@xxxxxxxxx>.
wrote:
Is there any reason why the last item in the traceback is one frame
below the top of the stack? It would be great to show the real line in
my editor...
Maybe your anonymous [HINT!] editor is confused. Do you get the same
problem when you run your script at the shell prompt?
--
http://mail.python.org/mailman/listinfo/python-list
- References:
- incorrect line reported in traceback
- From: Patrick Stinson
- Re: incorrect line reported in traceback
- From: John Machin
- incorrect line reported in traceback
- Prev by Date: Re: incorrect line reported in traceback
- Next by Date: Re: Emacs vs. Eclipse vs. Vim
- Previous by thread: Re: incorrect line reported in traceback
- Index(es):
Relevant Pages
|