Procházet zdrojové kódy

Fix pickling protocol to use highest available.

This fixes unpickling errors in Python 2.7 as it defaults to the text
protocol.
Rolando Espinoza před 8 roky
rodič
revize
d446bb1c19
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      python/setup.py

+ 1 - 1
python/setup.py

@@ -31,7 +31,7 @@ class BuildPyCommand(build_py):
                 model_code = f.read()
                 model_code = f.read()
             sm = StanModel(model_code=model_code)
             sm = StanModel(model_code=model_code)
             with open(os.path.join(target_dir, '{}_growth.pkl'.format(model_type)), 'wb') as f:
             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):
 class TestCommand(test_command):
     """We must run tests on the build directory, not source."""
     """We must run tests on the build directory, not source."""