title: How can I modify a Python traceback object when raising an exception?
body: <p>I'm working on a Python library used by third-party developers to write extensions for our core application.</p>
  
  <p>I'd like to know if it's possible to modify the traceback when raising exceptions, so the last stack frame is the call to the library function in the developer's code, rather than the line in the library that raised the exception. There are also a few frames at the bottom of the stack containing references to functions used when first loading the code that I'd ideally like to remove too.</p>
  
  <p>Thanks in advance for any advice!</p>