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 str = str
unicode = unicode unicode = unicode
bytes = str bytes = str
basestring = basestring try: basestring = basestring
import cPickle as pickle try:
if isinstance(file_or_path, basestring): import cPickle as pickle
with open(file_or_path, 'rb') as f: if isinstance(file_or_path, basestring):
m = pickle.load(f) with open(file_or_path, 'rb') as f:
m = pickle.load(f)
else: else:
m = pickle.load(file_or_path) m = pickle.load(file_or_path)
except: except: