fix FileNotFoundError

This commit is contained in:
Cayo Puigdefabregas 2024-06-03 21:06:43 +02:00
parent 305f95865c
commit 10a2d680af
2 changed files with 9 additions and 5 deletions

View File

@ -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 {}

View File

@ -9,7 +9,7 @@ test_requires = [
setup( setup(
name="pyvckit", name="pyvckit",
version="0.0.4", version="0.0.6",
packages=['pyvckit'], packages=['pyvckit'],
install_requires=[ install_requires=[
"jsonref", "jsonref",