From 4787b0dbd26b407f2bb4058ffec76d9d36b7a7e6 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Sun, 11 Oct 2015 01:42:49 +0100 Subject: [PATCH] Update __init__.py --- GPy/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GPy/__init__.py b/GPy/__init__.py index 5bbdeff8..8af8a4f6 100644 --- a/GPy/__init__.py +++ b/GPy/__init__.py @@ -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: