chore: refurish python code by applying Pylint linter rules (#8322)

This commit is contained in:
Bowen Liang 2024-09-13 22:42:08 +08:00 • committed by GitHub
commit a1104ab97e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
126 changed files with 253 additions and 272 deletions

View file

@ -214,7 +214,7 @@ class Spider:
return requests.delete(url, headers=headers, stream=stream)
def _handle_error(self, response, action):
if response.status_code in [402, 409, 500]:
if response.status_code in {402, 409, 500}:
error_message = response.json().get("error", "Unknown error occurred")
raise Exception(f"Failed to {action}. Status code: {response.status_code}. Error: {error_message}")
else: