File tree Expand file tree Collapse file tree 2 files changed +0
-34
lines changed Expand file tree Collapse file tree 2 files changed +0
-34
lines changed Original file line number Diff line number Diff line change 1414#include <Python.h>
1515#include <stdio.h>
1616
17- #if PY_VERSION_HEX < 0x02050000
18- typedef int Py_ssize_t ;
19- #define PY_SSIZE_T_MAX INT_MAX
20- #define PY_SSIZE_T_MIN INT_MIN
21- #endif
22-
2317#ifdef PYPY_VERSION
2418#define COMPILING_IN_PYPY 1
2519#define COMPILING_IN_CPYTHON 0
@@ -216,8 +210,6 @@ static PyMethodDef cmurmur3_methods[] = {
216210 {NULL , NULL , 0 , NULL }
217211};
218212
219- #if PY_MAJOR_VERSION >= 3
220-
221213static int cmurmur3_traverse (PyObject * m , visitproc visit , void * arg ) {
222214 Py_VISIT (GETSTATE (m )-> error );
223215 return 0 ;
@@ -245,18 +237,8 @@ static struct PyModuleDef moduledef = {
245237PyObject *
246238PyInit_cmurmur3 (void )
247239
248- #else
249- #define INITERROR return
250-
251- void
252- initcmurmur3 (void )
253- #endif
254240{
255- #if PY_MAJOR_VERSION >= 3
256241 PyObject * module = PyModule_Create (& moduledef );
257- #else
258- PyObject * module = Py_InitModule ("cmurmur3" , cmurmur3_methods );
259- #endif
260242 struct module_state * st = NULL ;
261243
262244 if (module == NULL )
@@ -269,7 +251,5 @@ initcmurmur3(void)
269251 INITERROR ;
270252 }
271253
272- #if PY_MAJOR_VERSION >= 3
273254 return module ;
274- #endif
275255}
Original file line number Diff line number Diff line change @@ -583,7 +583,6 @@ static PyMethodDef module_methods[] = {
583583PyDoc_STRVAR (module_doc ,
584584"libev wrapper methods" );
585585
586- #if PY_MAJOR_VERSION >= 3
587586static struct PyModuleDef moduledef = {
588587 PyModuleDef_HEAD_INIT ,
589588 "libevwrapper" ,
@@ -600,13 +599,6 @@ static struct PyModuleDef moduledef = {
600599
601600PyObject *
602601PyInit_libevwrapper (void )
603-
604- # else
605- # define INITERROR return
606-
607- void
608- initlibevwrapper (void )
609- #endif
610602{
611603 PyObject * module = NULL ;
612604
@@ -629,11 +621,7 @@ initlibevwrapper(void)
629621 if (PyType_Ready (& libevwrapper_TimerType ) < 0 )
630622 INITERROR ;
631623
632- # if PY_MAJOR_VERSION >= 3
633624 module = PyModule_Create (& moduledef );
634- # else
635- module = Py_InitModule3 ("libevwrapper" , module_methods , module_doc );
636- # endif
637625
638626 if (module == NULL )
639627 INITERROR ;
@@ -674,7 +662,5 @@ initlibevwrapper(void)
674662 }
675663#endif
676664
677- #if PY_MAJOR_VERSION >= 3
678665 return module ;
679- #endif
680666}
You can’t perform that action at this time.
0 commit comments