File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -989,11 +989,15 @@ init_helpers(void)
989989#if PY_MAJOR_VERSION >= 3
990990 module = PyModule_Create (& moduledef );
991991#else
992- module = Py_InitModule ("_helpers" , helpers_methods , NULL );
992+ module = Py_InitModule3 ("_helpers" , helpers_methods , NULL );
993993#endif
994994
995995 if (module == NULL )
996+ #if PY_MAJOR_VERSION >= 3
996997 return NULL ;
998+ #else
999+ return ;
1000+ #endif
9971001
9981002 FixedOffset_type .tp_new = PyType_GenericNew ;
9991003 FixedOffset_type .tp_base = PyDateTimeAPI -> TZInfoType ;
@@ -1002,12 +1006,17 @@ init_helpers(void)
10021006 FixedOffset_type .tp_init = (initproc )FixedOffset_init ;
10031007
10041008 if (PyType_Ready (& FixedOffset_type ) < 0 )
1009+ #if PY_MAJOR_VERSION >= 3
10051010 return NULL ;
1011+ #else
1012+ return ;
1013+ #endif
10061014
10071015 Py_INCREF (& FixedOffset_type );
10081016
10091017 PyModule_AddObject (module , "TZFixedOffset" , (PyObject * )& FixedOffset_type );
1010-
1018+ #if PY_MAJOR_VERSION >= 3
10111019 return module ;
1020+ #endif
10121021}
10131022#endif
You can’t perform that action at this time.
0 commit comments