-
-
Notifications
You must be signed in to change notification settings - Fork 35k
bpo-42413: Replace concurrent.futures.TimeoutError and asyncio.TimeoutError with builtin TimeoutError #23520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5bb35d2
8550cbb
0b1abf5
46b3eb7
c2f8743
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,7 @@ class CancelledError(BaseException): | |
| """The Future or Task was cancelled.""" | ||
|
|
||
|
|
||
| class TimeoutError(Exception): | ||
| """The operation exceeded the given deadline.""" | ||
| TimeoutError = TimeoutError # make local alias for the standard exception | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to move this one to Please mention "bpo-42413:" in the comment. Like:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can but it increases a chance of backward incompatibility. The main reason is that IDE or another tool can insert |
||
|
|
||
|
|
||
| class InvalidStateError(Exception): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,10 +50,7 @@ class CancelledError(Error): | |
| """The Future was cancelled.""" | ||
| pass | ||
|
|
||
| class TimeoutError(Error): | ||
| """The operation exceeded the given deadline.""" | ||
| pass | ||
|
|
||
| TimeoutError = TimeoutError # make local alias for the standard exception | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark, can it be moved to |
||
| class InvalidStateError(Error): | ||
| """The operation is not allowed in this state.""" | ||
| pass | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Replace ``concurrent.futures.TimeoutError`` and ``asyncio.TimeoutError`` | ||
| with builtin :exc:`TimeoutError`, keep these names as deprecated aliases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can to deprecated it, you need to add the ".. deprecated::" markup. For now, I suggest to keep it. There is no need to remove the alias.
In Python 3.10, we kept the IOError alias, even if it's no longer used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text was copyed from @tiran PR about replacing a custom
socket.timeoutexception with an alias toTimeoutError: https://github.com/python/cpython/pull/23413/files#diff-e9e93d6b76a8a1cf0825d557b12e7ce3e67081cad650063eee520b81fd651943R286I can change it to something else if you insist.