Mercurial > public > mercurial-scm > hg-stable
diff mercurial/parsers.c @ 20159:96b2dd77c85d
parsers: backout version mismatch detection from 21dafd8546d1
This introduced mandatory recompilations and breaks pure mode in tests
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 01 Dec 2013 20:46:36 -0600 |
parents | 21dafd8546d1 |
children | 507919a34c5b |
line wrap: on
line diff
--- a/mercurial/parsers.c Sun Dec 01 14:10:53 2013 -0600 +++ b/mercurial/parsers.c Sun Dec 01 20:46:36 2013 -0600 @@ -1941,25 +1941,6 @@ dirstate_unset = Py_BuildValue("ciii", 'n', 0, -1, -1); } -static int check_python_version() -{ - PyObject *sys = PyImport_ImportModule("sys"); - PyObject *hexversion = PyObject_GetAttrString(sys, "hexversion"); - long version = PyInt_AsLong(hexversion); - /* sys.hexversion is a 32-bit number by default, so the -1 case - * should only occur in unusual circumstances (e.g. if sys.hexversion - * is manually set to an invalid value). */ - if ((version == -1) || (version >> 16 != PY_VERSION_HEX >> 16)) { - PyErr_Format(PyExc_ImportError, "Python minor version mismatch: " - "The Mercurial extension modules were compiled with Python " - PY_VERSION ", but Mercurial is currently using Python with " - "sys.hexversion=%ld: Python %s\n at: %s", version, - Py_GetVersion(), Py_GetProgramFullPath()); - return -1; - } - return 0; -} - #ifdef IS_PY3K static struct PyModuleDef parsers_module = { PyModuleDef_HEAD_INIT, @@ -1971,8 +1952,6 @@ PyMODINIT_FUNC PyInit_parsers(void) { - if (check_python_version() == -1) - return; PyObject *mod = PyModule_Create(&parsers_module); module_init(mod); return mod; @@ -1980,8 +1959,6 @@ #else PyMODINIT_FUNC initparsers(void) { - if (check_python_version() == -1) - return; PyObject *mod = Py_InitModule3("parsers", methods, parsers_doc); module_init(mod); }