aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-09-13 15:17:28 +0200
committerPapoteur <papoteur@mageialinux-online.org>2015-09-13 15:17:28 +0200
commit1df93215d22705cd15bf5bac930f703b32469929 (patch)
tree214662c9d2b3092796a03edbe4c71d2046077b5a
parentdfce065c6be3f61811c1b8461e8954996592f4f4 (diff)
downloadnet_monitor-1df93215d22705cd15bf5bac930f703b32469929.tar
net_monitor-1df93215d22705cd15bf5bac930f703b32469929.tar.gz
net_monitor-1df93215d22705cd15bf5bac930f703b32469929.tar.bz2
net_monitor-1df93215d22705cd15bf5bac930f703b32469929.tar.xz
net_monitor-1df93215d22705cd15bf5bac930f703b32469929.zip
Adaptation of _native module for Python 3
-rw-r--r--src/_native.c14
1 files 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);
}
-