Re: incorrect line reported in traceback



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

.



Relevant Pages

  • looking for IDE advice or workflow tips
    ... I can tell) and when I copy and paste lines into the interpreter only ... Is there an editor that allows me to send a few lines out of many ... running an entire script or creating a small script ... for every code block? ...
    (comp.lang.python)
  • Re: looking for IDE advice or workflow tips
    ... I can tell) and when I copy and paste lines into the interpreter only ... Is there an editor that allows me to send a few lines out of many ... running an entire script or creating a small script ... for every code block? ...
    (comp.lang.python)
  • Re: looking for IDE advice or workflow tips
    ... I can tell) and when I copy and paste lines into the interpreter only ... Is there an editor that allows me to send a few lines out of many ... running an entire script or creating a small script ... for every code block? ...
    (comp.lang.python)
  • Re: looking for IDE advice or workflow tips
    ... I can tell) and when I copy and paste lines into the interpreter only ... Is there an editor that allows me to send a few lines out of many ... running an entire script or creating a small script ... for every code block? ...
    (comp.lang.python)
  • Re: why write a script when u can write a vb6 app
    ... > Ofcourse writing a script is easier and faster, ... > editor or some other not so good editors. ... > What are the things that can NOT be done in a VB 6 app that could be done ...
    (microsoft.public.scripting.vbscript)