I want to be able to route embedded calls to the debugger
if a switch is set, but return the result to the caller,
so it can continue. I can do it now, by:
- to run a string expression 'str':
if debugging
pdb.run("_res = <str>")
res = getattr(main, "_res")
else
res = run_string(<str>,...)
- to run a func(*args):
predefine a dummy function:
def runit(func, args):
global _res
_res = apply(func, args)
if debugging
pdb.runcall(dummy.runit, func, args)
res = getattr(dummy, "_res")
else
res = call_object(func, args)
but this seems a roundabout way of doing it. Is there an
easy way to do this (subclassing Pdb,...)?
Mark L.