Mercurial > hg
comparison mercurial/cext/parsers.c @ 48810:ed03fffaac30
cext: remove Python 2 module initializer functions
We no longer need these since we dropped support for Python 2.
Differential Revision: https://phab.mercurial-scm.org/D12221
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 20 Feb 2022 15:40:39 -0700 |
parents | be2317167a9b |
children | 824b2082550e |
comparison
equal
deleted
inserted
replaced
48809:1d5fd9def5ac | 48810:ed03fffaac30 |
---|---|
1305 return -1; | 1305 return -1; |
1306 } | 1306 } |
1307 return 0; | 1307 return 0; |
1308 } | 1308 } |
1309 | 1309 |
1310 #ifdef IS_PY3K | |
1311 static struct PyModuleDef parsers_module = {PyModuleDef_HEAD_INIT, "parsers", | 1310 static struct PyModuleDef parsers_module = {PyModuleDef_HEAD_INIT, "parsers", |
1312 parsers_doc, -1, methods}; | 1311 parsers_doc, -1, methods}; |
1313 | 1312 |
1314 PyMODINIT_FUNC PyInit_parsers(void) | 1313 PyMODINIT_FUNC PyInit_parsers(void) |
1315 { | 1314 { |
1319 return NULL; | 1318 return NULL; |
1320 mod = PyModule_Create(&parsers_module); | 1319 mod = PyModule_Create(&parsers_module); |
1321 module_init(mod); | 1320 module_init(mod); |
1322 return mod; | 1321 return mod; |
1323 } | 1322 } |
1324 #else | |
1325 PyMODINIT_FUNC initparsers(void) | |
1326 { | |
1327 PyObject *mod; | |
1328 | |
1329 if (check_python_version() == -1) { | |
1330 return; | |
1331 } | |
1332 mod = Py_InitModule3("parsers", methods, parsers_doc); | |
1333 module_init(mod); | |
1334 } | |
1335 #endif |