# HG changeset patch # User Jun Wu # Date 2017-04-26 00:45:48 # Node ID 7948adb53e285125e34ad3c3b36983541fca55ec # Parent 4195b84940e95b8b9aed5bc04b06b398edb5ce74 base85: add version to help detect breaking binary changes diff --git a/mercurial/base85.c b/mercurial/base85.c --- a/mercurial/base85.c +++ b/mercurial/base85.c @@ -157,6 +157,8 @@ static PyMethodDef methods[] = { {NULL, NULL} }; +static const int version = 1; + #ifdef IS_PY3K static struct PyModuleDef base85_module = { PyModuleDef_HEAD_INIT, @@ -168,15 +170,20 @@ static struct PyModuleDef base85_module PyMODINIT_FUNC PyInit_base85(void) { + PyObject *m; b85prep(); - return PyModule_Create(&base85_module); + m = PyModule_Create(&base85_module); + PyModule_AddIntConstant(m, "version", version); + return m; } #else PyMODINIT_FUNC initbase85(void) { - Py_InitModule3("base85", methods, base85_doc); + PyObject *m; + m = Py_InitModule3("base85", methods, base85_doc); b85prep(); + PyModule_AddIntConstant(m, "version", version); } #endif