diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 947e43d5..118c4818 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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" diff --git a/alab_management/resource_manager/resource_requester.py b/alab_management/resource_manager/resource_requester.py index ff549a80..c996b117 100644 --- a/alab_management/resource_manager/resource_requester.py +++ b/alab_management/resource_manager/resource_requester.py @@ -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):