From 1df93215d22705cd15bf5bac930f703b32469929 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Sun, 13 Sep 2015 15:17:28 +0200 Subject: Adaptation of _native module for Python 3 --- src/_native.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/_native.c b/src/_native.c index e4c31c3..b7fd9e8 100644 --- a/src/_native.c +++ b/src/_native.c @@ -310,9 +310,15 @@ static PyMethodDef net_monitor_Methods[] = { {NULL, NULL, 0, NULL} /* Sentinel */ }; -PyMODINIT_FUNC -init_native(void) +static PyModuleDef net_monitor_Module = { + PyModuleDef_HEAD_INIT, + "_native", /* name of module */ + "", /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + net_monitor_Methods +}; + +PyMODINIT_FUNC PyInit__native(void) { - (void) Py_InitModule("_native", net_monitor_Methods); + return PyModule_Create(&net_monitor_Module); } - -- cgit v1.2.1