python: use isinstance instead of type() (#16516)

Use of `isinstance` is preferred (and validated by common linters).
This commit is contained in:
jessemyers-lettuce
2023-09-05 08:45:18 -07:00
committed by GitHub
parent 4b7a808a9f
commit 1b32088c2d
4 changed files with 4 additions and 4 deletions

View File

@@ -227,7 +227,7 @@ class ApiClient:
# data needs deserialization or returns HTTP data (deserialized) only
if _preload_content or _return_http_data_only:
response_type = response_types_map.get(str(response_data.status), None)
if not response_type and type(response_data.status) == int and 100 <= response_data.status <= 599:
if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)