From c5801cfe2fa078e1caffeeb701dc56daf6436273 Mon Sep 17 00:00:00 2001 From: Julian Hammer Date: Fri, 20 Mar 2020 15:02:30 +0100 Subject: [PATCH] closing cache file --- osaca/semantics/hw_model.py | 3 ++- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osaca/semantics/hw_model.py b/osaca/semantics/hw_model.py index ef6a61d..a904b32 100755 --- a/osaca/semantics/hw_model.py +++ b/osaca/semantics/hw_model.py @@ -318,7 +318,8 @@ class MachineModel(object): # Check if modification date of DB is older than cached version if os.path.getmtime(filepath) < os.path.getmtime(cachepath): # load cached version - cached_db = pickle.load(open(cachepath, 'rb')) + with open(cachepath, 'rb') as f: + cached_db = pickle.load(f) return cached_db else: # DB newer than cached version --> delete cached file and return False diff --git a/setup.py b/setup.py index 8604f3d..2e380b8 100755 --- a/setup.py +++ b/setup.py @@ -91,8 +91,8 @@ setup( # https://packaging.python.org/en/latest/requirements.html install_requires=[ 'networkx', - 'pyparsing', - 'ruamel.yaml', + 'pyparsing>=2.3.1', + 'ruamel.yaml>=0.15.71', ], python_requires='>=3.5',