miniupnpc/miniupnpcmidule.c: fix for both python2 and python3

This commit is contained in:
Thomas Bernard 2014-09-06 10:01:15 +02:00
parent f3fb046e45
commit c7b0c20502
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $Id: miniupnpcmodule.c,v 1.22 2014/01/31 13:18:25 nanard Exp $*/ /* $Id: miniupnpcmodule.c,v 1.24 2014/06/10 09:48:11 nanard Exp $*/
/* Project : miniupnp /* Project : miniupnp
* Author : Thomas BERNARD * Author : Thomas BERNARD
* website : http://miniupnp.tuxfamily.org/ * website : http://miniupnp.tuxfamily.org/
@ -599,7 +599,11 @@ initminiupnpc(void)
UPnPType.tp_new = PyType_GenericNew; UPnPType.tp_new = PyType_GenericNew;
#endif #endif
if (PyType_Ready(&UPnPType) < 0) if (PyType_Ready(&UPnPType) < 0)
#if PY_MAJOR_VERSION >= 3
return 0; return 0;
#else
return;
#endif
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
m = PyModule_Create(&moduledef); m = PyModule_Create(&moduledef);