Show More
@@ -1301,6 +1301,8 b' static PyMethodDef methods[] = {' | |||
|
1301 | 1301 | {NULL, NULL} |
|
1302 | 1302 | }; |
|
1303 | 1303 | |
|
1304 | static const int version = 1; | |
|
1305 | ||
|
1304 | 1306 | #ifdef IS_PY3K |
|
1305 | 1307 | static struct PyModuleDef osutil_module = { |
|
1306 | 1308 | PyModuleDef_HEAD_INIT, |
@@ -1312,17 +1314,22 b' static struct PyModuleDef osutil_module ' | |||
|
1312 | 1314 | |
|
1313 | 1315 | PyMODINIT_FUNC PyInit_osutil(void) |
|
1314 | 1316 | { |
|
1317 | PyObject *m; | |
|
1315 | 1318 | if (PyType_Ready(&listdir_stat_type) < 0) |
|
1316 | 1319 | return NULL; |
|
1317 | 1320 | |
|
1318 |
|
|
|
1321 | m = PyModule_Create(&osutil_module); | |
|
1322 | PyModule_AddIntConstant(m, "version", version); | |
|
1323 | return m; | |
|
1319 | 1324 | } |
|
1320 | 1325 | #else |
|
1321 | 1326 | PyMODINIT_FUNC initosutil(void) |
|
1322 | 1327 | { |
|
1328 | PyObject *m; | |
|
1323 | 1329 | if (PyType_Ready(&listdir_stat_type) == -1) |
|
1324 | 1330 | return; |
|
1325 | 1331 | |
|
1326 | Py_InitModule3("osutil", methods, osutil_doc); | |
|
1332 | m = Py_InitModule3("osutil", methods, osutil_doc); | |
|
1333 | PyModule_AddIntConstant(m, "version", version); | |
|
1327 | 1334 | } |
|
1328 | 1335 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now