Skip to content
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

Fix the TimeoutError in Python 3.11 and add CI for Python==3.11 #80

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
timeout-minutes: 60
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.10", "3.11"]
services:
rabbitmq:
image: "rabbitmq:3.9"
Expand Down
16 changes: 11 additions & 5 deletions alab_management/resource_manager/resource_requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ class RequestCanceledError(Exception):
"""Request Canceled Error."""


class CombinedTimeoutError(TimeoutError, concurrent.futures.TimeoutError):
"""
Combined TimeoutError.
# considering concurrent.futures.TimeoutError and TimeoutError becomes the same
# from Python 3.11. We should determine the base class of this exception.
if isinstance(concurrent.futures.TimeoutError, TimeoutError):
CombinedTimeoutError = TimeoutError
else:

If you catch either TimeoutError or concurrent.futures.TimeoutError, this will catch both.
"""
class CombinedTimeoutError(TimeoutError, concurrent.futures.TimeoutError):
"""
Combined TimeoutError.

If you catch either TimeoutError or concurrent.futures.TimeoutError, this will catch both.
"""


class DeviceRequest(BaseModel):
Expand Down
Loading