I\'m working on a Python library used by third-party developers to write extensions for our core application.
I\'d like to know if it\'s possible to modify the trace
What about not changing the traceback? The two things you request can both be done more easily in a different way.
That said, it should be quite possible to munge the tracebacks if you really need to... but where would you do it? If in some wrapper code at the very top level, then you could simply grab the traceback, take a slice to remove the parts you don't want, and then use functions in the "traceback" module to format/print as desired.