[issue47099] Replace with_traceback() with exception chaining and reraising

2022-03-30 Thread Oleg Iarygin
Change by Oleg Iarygin : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue47099] Replace with_traceback() with exception chaining and reraising

2022-03-23 Thread Irit Katriel
Irit Katriel added the comment: You don't need sys.exc_info() for the traceback anymore. except Exception as e: raise OSError('blah').with_traceback(e.__traceback__) -- nosy: +iritkatriel ___ Python tracker

[issue47099] Replace with_traceback() with exception chaining and reraising

2022-03-23 Thread Oleg Iarygin
Change by Oleg Iarygin : -- keywords: +patch pull_requests: +30162 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32074 ___ Python tracker ___ ___

[issue47099] Replace with_traceback() with exception chaining and reraising

2022-03-23 Thread Oleg Iarygin
New submission from Oleg Iarygin : Currently, exception chaining in Lib/ modules is implemented with pre-3.11 `raise Foo(...).with_traceback(sys.exc_info()[2])`. However, this approach can be simplified: 1. PEP 3134 introduced a proper `raise Foo(...) from bar` construction that takes a pare