From 163e541a0dd37fa644e6b1c676c36cf79e17e815 Mon Sep 17 00:00:00 2001 From: Angel Farguell Caus Date: Tue, 22 Oct 2019 11:40:21 -0600 Subject: [PATCH] support using saveload in python 3 --- saveload.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/saveload.py b/saveload.py index cfabaee..6ad1887 100644 --- a/saveload.py +++ b/saveload.py @@ -15,7 +15,9 @@ def load(file): :return: the object read """ with open(file,'rb') as f: - return pickle.load(f) - - - + try: + # python 2 + return pickle.load(f) + except ImportError: + # python 3 + return pickle.load(f,encoding='latin1') -- 2.11.4.GIT