gcc vsh.c -o vsh
 
 setns: setns.c
-       python setup.py build
+       python3 setup.py build
 
 ########## sync
 # for use with the test framework; push local stuff on a test node
 # this will attempt to compile vsh from vsh.c
 # so you might have to yum install gcc
 
-LOCAL_RSYNC_EXCLUDES   := --exclude '*.pyc' 
+LOCAL_RSYNC_EXCLUDES   := --exclude '*.pyc'
 RSYNC_EXCLUDES         := --exclude .git  --exclude .svn --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
 RSYNC_COND_DRY_RUN     := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
 RSYNC                  := rsync -e "ssh -i $(NODE).key.rsa" -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
        chmod u+s /usr/sbin/lxcsu
        chmod u+s /usr/sbin/slicesu
        chmod u+s /usr/sbin/vsh
-       cp build/lib*/setns.so /usr/sbin
+       cp build/lib*/setns.*.so /usr/sbin/setns.so
 
        {NULL, NULL, 0, NULL}
 };
 
-PyMODINIT_FUNC
+static struct PyModuleDef moduledef = {
+       PyModuleDef_HEAD_INIT,
+       "setns",
+       "http://git.onelab.eu/?p=lxc-userspace.git;a=summary",
+       -1,
+       SetnsMethods,
+       NULL,
+       NULL,
+       NULL,
+       NULL
+};
 
-initsetns(void)
-{
-       (void) Py_InitModule("setns", SetnsMethods);
+PyObject *PyInit_setns(void){
+       PyObject *module = PyModule_Create(&moduledef);
+    if (module == NULL)
+        return NULL;
+       return module;
 }