-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
THRIFT-5715 Python Exceptions mutable with slots
In Python 3.11 exceptions generated by the compiler can't be used with a context manager because they are immutable. As of Python 3.11 `contextlib.contextmanager` sets `exc.__traceback__` in the event that the code in the context manager errors. As of Thrift v0.18.1 exceptions are generated as immutable by default. See [PR#1835](#1835) for more information about why exceptions were made immutable by default. This change makes all non-Thrift fields mutable when slots is used without dynamic. This will allow exceptions to be re-raised properly by the contextmanager in Python 3.11.
- Loading branch information
1 parent
284e6b3
commit d3d8fd7
Showing
2 changed files
with
65 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters