Mercurial > hg
comparison mercurial/cext/osutil.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 | d4ba4d51f85f |
children | 41bd7e8fc82e |
comparison
equal
deleted
inserted
replaced
48809:1d5fd9def5ac | 48810:ed03fffaac30 |
---|---|
1385 {NULL, NULL} | 1385 {NULL, NULL} |
1386 }; | 1386 }; |
1387 | 1387 |
1388 static const int version = 4; | 1388 static const int version = 4; |
1389 | 1389 |
1390 #ifdef IS_PY3K | |
1391 static struct PyModuleDef osutil_module = { | 1390 static struct PyModuleDef osutil_module = { |
1392 PyModuleDef_HEAD_INIT, | 1391 PyModuleDef_HEAD_INIT, |
1393 "osutil", | 1392 "osutil", |
1394 osutil_doc, | 1393 osutil_doc, |
1395 -1, | 1394 -1, |
1404 | 1403 |
1405 m = PyModule_Create(&osutil_module); | 1404 m = PyModule_Create(&osutil_module); |
1406 PyModule_AddIntConstant(m, "version", version); | 1405 PyModule_AddIntConstant(m, "version", version); |
1407 return m; | 1406 return m; |
1408 } | 1407 } |
1409 #else | |
1410 PyMODINIT_FUNC initosutil(void) | |
1411 { | |
1412 PyObject *m; | |
1413 if (PyType_Ready(&listdir_stat_type) == -1) | |
1414 return; | |
1415 | |
1416 m = Py_InitModule3("osutil", methods, osutil_doc); | |
1417 PyModule_AddIntConstant(m, "version", version); | |
1418 } | |
1419 #endif |