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',