(cherry picked from commit e05cad785e
)
This commit is contained in:
parent
23e57fe095
commit
8b8455523d
2 changed files with 4 additions and 2 deletions
|
@ -895,7 +895,8 @@ class TaskExecutor:
|
|||
else:
|
||||
try:
|
||||
result = json.loads(to_text(stderr, errors='surrogate_then_replace'))
|
||||
except json.decoder.JSONDecodeError:
|
||||
except getattr(json.decoder, 'JSONDecodeError', ValueError):
|
||||
# JSONDecodeError only available on Python 3.5+
|
||||
result = {'error': to_text(stderr, errors='surrogate_then_replace')}
|
||||
|
||||
if 'messages' in result:
|
||||
|
|
|
@ -115,7 +115,8 @@ class Connection(ConnectionBase):
|
|||
else:
|
||||
try:
|
||||
result = json.loads(to_text(stderr, errors='surrogate_then_replace'))
|
||||
except json.decoder.JSONDecodeError:
|
||||
except getattr(json.decoder, 'JSONDecodeError', ValueError):
|
||||
# JSONDecodeError only available on Python 3.5+
|
||||
result = {'error': to_text(stderr, errors='surrogate_then_replace')}
|
||||
|
||||
if 'messages' in result:
|
||||
|
|
Loading…
Reference in a new issue