mercurial/parsers.c
changeset 20159 96b2dd77c85d
parent 20155 21dafd8546d1
child 20169 507919a34c5b
--- 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);
 }