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():
with open("cache_context.json") as f:
doc_str = f.read()
if doc_str:
return json.loads(doc_str)
try:
with open("cache_context.json") as f:
doc_str = f.read()
if doc_str:
return json.loads(doc_str)
except FileNotFoundError:
pass
return {}

View file

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