File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -2264,7 +2264,11 @@ PYRABBITMQ_MOD_INIT(_librabbitmq)
22642264 PyObject * module , * socket_module ;
22652265
22662266 if (PyType_Ready (& PyRabbitMQ_ConnectionType ) < 0 ) {
2267+ #if PY_MAJOR_VERSION >= 3
2268+ return NULL ;
2269+ #else
22672270 return ;
2271+ #endif
22682272 }
22692273
22702274#if PY_MAJOR_VERSION >= 3
@@ -2275,13 +2279,22 @@ PYRABBITMQ_MOD_INIT(_librabbitmq)
22752279#endif
22762280
22772281 if (module == NULL ) {
2282+ #if PY_MAJOR_VERSION >= 3
2283+ return NULL ;
2284+ #else
22782285 return ;
2286+ #endif
22792287 }
22802288
22812289 /* Get socket.error */
22822290 socket_module = PyImport_ImportModule ("socket" );
2283- if (!socket_module )
2291+ if (!socket_module ) {
2292+ #if PY_MAJOR_VERSION >= 3
2293+ return NULL ;
2294+ #else
22842295 return ;
2296+ #endif
2297+ }
22852298 PyRabbitMQ_socket_timeout = PyObject_GetAttrString (socket_module , "timeout" );
22862299 Py_XDECREF (socket_module );
22872300
You can’t perform that action at this time.
0 commit comments