From 3bddc491d6c1c135ee937d1ba884f7cef4e4860c Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 23 Nov 2019 01:58:18 +0100 Subject: fix Benchmark and facter load functions --- src/benchmark.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/benchmark.py') diff --git a/src/benchmark.py b/src/benchmark.py index e1b598f..fc42763 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -193,12 +193,12 @@ class Benchmark: if os.path.exists(filename + ".json"): import json filename += ".json" - with open(filename, "w") as f: + with open(filename, "r") as f: self.results = json.load(f) - if os.path.exists(filename + ".save"): + elif os.path.exists(filename + ".save"): import pickle filename += ".save" - with open(filename, "wb") as f: + with open(filename, "rb") as f: self.results = pickle.load(f) else: raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), filename) -- cgit v1.2.3