Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • sys.stderr is just a file-like object, so before calling the module code you could record the position in the stream and after calling that piece of code just read it from that position to the end. Commented May 9, 2014 at 19:50
  • What is the imported module? It looks to me that it should re-raise the exception, rather than just log it but otherwise ignore it. Commented May 9, 2014 at 19:57
  • its a custom 3rd party module. The exception is raised by the imported program and then ignored by the calling program. this is normal, but I want to capture it in the calling program. Not sure how to implement Midnighter's suggestion Commented May 9, 2014 at 20:05