From f9b65c022ae8713835586b5f71796bee9511b175 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Fri, 10 Jan 2014 10:28:53 +0000 Subject: [PATCH] pickling now allways binary as well as protocol -1 --- GPy/core/parameterized.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/GPy/core/parameterized.py b/GPy/core/parameterized.py index de1adaf8..0e08e2c0 100644 --- a/GPy/core/parameterized.py +++ b/GPy/core/parameterized.py @@ -31,14 +31,9 @@ class Parameterized(object): # """ Override for which names to print out, when using print m """ # return self._get_param_names() - def pickle(self, filename, protocol=None): - if protocol is None: - if self._has_get_set_state(): - protocol = 0 - else: - protocol = -1 - with open(filename, 'w') as f: - cPickle.dump(self, f, protocol) + def pickle(self, filename, protocol=-1): + with open(filename, 'wb') as f: + cPickle.dump(self, f, protocol=protocol) def copy(self): """Returns a (deep) copy of the current model """