From e133c424a041a4e56628bf3158c9aad6aa56fe7e Mon Sep 17 00:00:00 2001 From: Yuxing Fei <564686325@qq.com> Date: Sun, 6 Oct 2024 18:23:30 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"fix(bug):=20fix=20the=20TimeoutError?= =?UTF-8?q?=20in=20Python=203.11=20and=20add=20CI=20for=20Python=3D=3D?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3711257257bdf2a6faee07530faa8f63551a646e. --- .github/workflows/ci.yaml | 2 +- .../resource_manager/resource_requester.py | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 118c4818..947e43d5 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", "3.11"] + python-version: ["3.10"] 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 c996b117..ff549a80 100644 --- a/alab_management/resource_manager/resource_requester.py +++ b/alab_management/resource_manager/resource_requester.py @@ -34,18 +34,12 @@ class RequestCanceledError(Exception): """Request Canceled Error.""" -# 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: - - class CombinedTimeoutError(TimeoutError, concurrent.futures.TimeoutError): - """ - Combined TimeoutError. +class CombinedTimeoutError(TimeoutError, concurrent.futures.TimeoutError): + """ + Combined TimeoutError. - If you catch either TimeoutError or concurrent.futures.TimeoutError, this will catch both. - """ + If you catch either TimeoutError or concurrent.futures.TimeoutError, this will catch both. + """ class DeviceRequest(BaseModel):