ibzib commented on pull request #15417:
URL: https://github.com/apache/beam/pull/15417#issuecomment-918702203


   Hi @lazylynx I don't think we should need to implement custom exception 
handling like this. I researched this issue and found 
https://www.python.org/dev/peps/pep-3134. The summary is that re-raising 
exceptions caused the original traceback to be lost in Python 2, but it was 
fixed in Python 3. So we needed `sys.exc_info()` in Python 2, but I think we 
can remove `sys.exc_info()` now and simply store and re-raise exceptions 
without worrying about losing the traceback. You can see the difference for 
yourself by running this script with Python 2 and then Python 3.
   
   ```
   import traceback
   
   try:
       raise ValueError('oops')
   except ValueError as e:
       exc = e
   
   raise exc
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to