mirror of
https://github.com/clearml/clearml
synced 2025-02-12 07:35:08 +00:00
Fix compatibility issue with requests < 2.28
This commit is contained in:
parent
d131ff2a45
commit
76076b09dd
@ -25,6 +25,8 @@ class InterfaceBase(SessionInterface):
|
|||||||
_default_session = None
|
_default_session = None
|
||||||
_num_retry_warning_display = 1
|
_num_retry_warning_display = 1
|
||||||
_offline_mode = ENV_OFFLINE_MODE.get()
|
_offline_mode = ENV_OFFLINE_MODE.get()
|
||||||
|
_JSON_EXCEPTION = (jsonschema.ValidationError, requests.exceptions.InvalidJSONError) \
|
||||||
|
if hasattr(requests.exceptions, "InvalidJSONError") else (jsonschema.ValidationError,)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def session(self):
|
def session(self):
|
||||||
@ -83,7 +85,7 @@ class InterfaceBase(SessionInterface):
|
|||||||
if raise_on_errors:
|
if raise_on_errors:
|
||||||
raise
|
raise
|
||||||
res = None
|
res = None
|
||||||
except (jsonschema.ValidationError, requests.exceptions.InvalidJSONError) as e:
|
except cls._JSON_EXCEPTION as e:
|
||||||
if log:
|
if log:
|
||||||
log.error(
|
log.error(
|
||||||
'Field %s contains illegal schema: %s', '.'.join(e.path), str(e.message)
|
'Field %s contains illegal schema: %s', '.'.join(e.path), str(e.message)
|
||||||
|
Loading…
Reference in New Issue
Block a user