From 236a557dd3390ce61a5d95302c70dd7990381bd3 Mon Sep 17 00:00:00 2001 From: morvanzhou Date: Fri, 23 Aug 2024 17:56:05 +0800 Subject: [PATCH] fix(not install error): cos --- src/retk/core/utils/cos.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/retk/core/utils/cos.py b/src/retk/core/utils/cos.py index 83cc4ea..45f5125 100644 --- a/src/retk/core/utils/cos.py +++ b/src/retk/core/utils/cos.py @@ -6,7 +6,7 @@ try: from qcloud_cos import ( - CosConfig, CosS3Client, CosServiceError, CosClientError + CosConfig, CosS3Client, CosServiceError ) except ImportError: pass @@ -32,7 +32,8 @@ def init(self): Domain=settings.COS_DOMAIN, Scheme='https', ) - except CosClientError: + except Exception: # pylint: disable=broad-except + # CosClientError logger.info("COSClient | COS settings not found") raise ModuleNotFoundError("COS settings not found") self.domain = settings.COS_DOMAIN or f"{settings.COS_BUCKET_NAME}.cos.{settings.COS_REGION}.myqcloud.com"