Return list

main
bashrc 2026-08-01 14:47:12 +01:00
parent ad5f20dd2d
commit 148374845f
1 changed files with 3 additions and 3 deletions

View File

@ -837,14 +837,14 @@ class JsonLdProcessor(object):
if remote_doc['document'] is None: if remote_doc['document'] is None:
print('EX: ' + print('EX: ' +
'No remote document found at the given URL.') 'No remote document found at the given URL.')
return None return []
if _is_string(remote_doc['document']): if _is_string(remote_doc['document']):
remote_doc['document'] = json.loads(remote_doc['document']) remote_doc['document'] = json.loads(remote_doc['document'])
except BaseException as cause: except BaseException as cause:
print('EX: ' + print('EX: ' +
'Could not retrieve a JSON-LD document from the URL. ' + 'Could not retrieve a JSON-LD document from the URL. ' +
str(cause)) str(cause))
return None return []
# set default base # set default base
options.setdefault('base', remote_doc['documentUrl'] or '') options.setdefault('base', remote_doc['documentUrl'] or '')
@ -867,7 +867,7 @@ class JsonLdProcessor(object):
except BaseException as cause: except BaseException as cause:
print('EX: ' + print('EX: ' +
'Could not perform JSON-LD expansion. ' + str(cause)) 'Could not perform JSON-LD expansion. ' + str(cause))
return None return []
active_ctx = self._get_initial_context(options) active_ctx = self._get_initial_context(options)
document = input_['document'] document = input_['document']