mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 08:46:55 +00:00
python: use isinstance instead of type() (#16516)
Use of `isinstance` is preferred (and validated by common linters).
This commit is contained in:
committed by
GitHub
parent
4b7a808a9f
commit
1b32088c2d
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user