Re: "assert" annoyance



On 6/21/07, Miles <semanticist@xxxxxxxxx> wrote:
On Jun 22, 1:31 am, Paul Rubin <http://phr...@xxxxxxxxxxxxxx> wrote:
> What I really want is for any assertion failure, anywhere in the
> program, to trap to the debugger WITHOUT blowing out of the scope
> where the failure happened, so I can examine the local frame. That
> just seems natural, but I don't see an obvious way to do it.

You could run the entire program through pdb:
----
#!/usr/bin/env python -m pdb

print "Hello!"
assert False
print "...world!"
----

You can only pass one argument to a command that you invoke with the
shebang sequence, so this won't work the way you wrote it.

--
Evan Klitzke <evan@xxxxxxxx>
.



Relevant Pages

  • Re: EnumChildWindows
    ... The important thing when you get an assertion failure is to drop into the debugger and ... best-guess rather than being absolutely confident that it is the problem. ...
    (microsoft.public.vc.mfc)
  • Re: Please help me, i got message Assertation falure line 47 _block_type_is_valid(phead->nBlockT
    ... When you get an assertion failure, attach the debugger and follow the call stack to the place in YOUR code that caused this assertion. ...
    (microsoft.public.vc.language)
  • Re: "assert" annoyance
    ... On 6/22/07, Miles wrote: ... >>> What I really want is for any assertion failure, ... to trap to the debugger WITHOUT blowing out of the scope ... Evan Klitzke ...
    (comp.lang.python)