fix FileNotFoundError
This commit is contained in:
parent
305f95865c
commit
10a2d680af
|
@ -19,10 +19,14 @@ from pyld.jsonld import (JsonLdError, parse_link_header, LINK_HEADER_REL)
|
||||||
|
|
||||||
|
|
||||||
def get_cache():
|
def get_cache():
|
||||||
with open("cache_context.json") as f:
|
try:
|
||||||
doc_str = f.read()
|
with open("cache_context.json") as f:
|
||||||
if doc_str:
|
doc_str = f.read()
|
||||||
return json.loads(doc_str)
|
if doc_str:
|
||||||
|
return json.loads(doc_str)
|
||||||
|
except FileNotFoundError:
|
||||||
|
pass
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue