From c7c18f043711fbc750d3de73a21e4556f1104eb5 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Sun, 11 Oct 2015 02:04:16 +0100 Subject: [PATCH] Update __init__.py --- GPy/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/GPy/__init__.py b/GPy/__init__.py index 506ad866..5af56dc4 100644 --- a/GPy/__init__.py +++ b/GPy/__init__.py @@ -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: