Update __init__.py

This commit is contained in:
Max Zwiessele 2015-10-11 01:42:49 +01:00
parent 812d1aa350
commit 4787b0dbd2

View file

@ -42,16 +42,20 @@ def load(file_or_path):
:param file_name: path/to/file.pickle
"""
try:
str = basestring
except:
pass
try:
import cPickle as pickle
if isinstance(file_or_path, basestring):
if isinstance(file_or_path, str):
with open(file_or_path, 'rb') as f:
m = pickle.load(f)
else:
m = pickle.load(file_or_path)
except:
import pickle
if isinstance(file_or_path, basestring):
if isinstance(file_or_path, str):
with open(file_or_path, 'rb') as f:
m = pickle.load(f)
else: