Skip to content

Commit

Permalink
remove Gen.2 pickle
Browse files Browse the repository at this point in the history
  • Loading branch information
iBug committed Sep 19, 2018
1 parent 6d885d3 commit fe134a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions datahandling.py
Expand Up @@ -50,6 +50,8 @@ def _load_pickle(path, encoding='utf-8'):
def _dump_pickle(path, item, protocol=pickle.HIGHEST_PROTOCOL):
if not os.path.isdir(PICKLE_STORAGE):
os.mkdir(PICKLE_STORAGE)
if os.path.isfile(path): # Remove old one
os.remove(path)
newpath = os.path.join(PICKLE_STORAGE, path)
with open(newpath, "wb") as f:
pickle.dump(item, f, protocol=protocol)
Expand Down

0 comments on commit fe134a1

Please sign in to comment.