From 559f25a06d16c4ad9f8eec99611460aed2e561b2 Mon Sep 17 00:00:00 2001 From: Bianca Yang Date: Fri, 26 Apr 2024 11:16:16 -0700 Subject: [PATCH] lint --- ee/billing/billing_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/billing/billing_manager.py b/ee/billing/billing_manager.py index f564ffb160a03..93eebe19a6d6c 100644 --- a/ee/billing/billing_manager.py +++ b/ee/billing/billing_manager.py @@ -1,3 +1,4 @@ +import json from datetime import datetime, timedelta from typing import Any, Optional, cast @@ -5,7 +6,6 @@ import requests import structlog from django.utils import timezone -from requests.exceptions import JSONDecodeError from rest_framework.exceptions import NotAuthenticated from sentry_sdk import capture_exception @@ -48,7 +48,7 @@ def handle_billing_service_error(res: requests.Response, valid_codes=(200, 404, try: response = res.json() raise Exception(f"Billing service returned bad status code: {res.status_code}", f"body:", response) - except JSONDecodeError: + except json.decoder.JSONDecodeError: raise Exception(f"Billing service returned bad status code: {res.status_code}", f"body:", res.text)