Update __init__.py

This commit is contained in:
Max Zwiessele 2015-10-11 02:04:16 +01:00
parent 0d74681ee2
commit c7c18f0437

View file

@ -55,11 +55,12 @@ def load(file_or_path):
str = str
unicode = unicode
bytes = str
basestring = basestring try:
import cPickle as pickle
if isinstance(file_or_path, basestring):
with open(file_or_path, 'rb') as f:
m = pickle.load(f)
basestring = basestring
try:
import cPickle as pickle
if isinstance(file_or_path, basestring):
with open(file_or_path, 'rb') as f:
m = pickle.load(f)
else:
m = pickle.load(file_or_path)
except: