From d446bb1c196124920f6a7fa98c71ee0756115e72 Mon Sep 17 00:00:00 2001 From: Rolando Espinoza Date: Wed, 8 Mar 2017 16:34:08 -0300 Subject: [PATCH] Fix pickling protocol to use highest available. This fixes unpickling errors in Python 2.7 as it defaults to the text protocol. --- python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 308db20..f9c94b1 100644 --- a/python/setup.py +++ b/python/setup.py @@ -31,7 +31,7 @@ class BuildPyCommand(build_py): model_code = f.read() sm = StanModel(model_code=model_code) with open(os.path.join(target_dir, '{}_growth.pkl'.format(model_type)), 'wb') as f: - pickle.dump(sm, f) + pickle.dump(sm, f, protocol=pickle.HIGHEST_PROTOCOL) class TestCommand(test_command): """We must run tests on the build directory, not source."""