Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python2.5 or older support #3

Closed
tanbro opened this issue Jan 6, 2012 · 2 comments
Closed

Add Python2.5 or older support #3

tanbro opened this issue Jan 6, 2012 · 2 comments

Comments

@tanbro
Copy link

tanbro commented Jan 6, 2012

add following code to pyuv.c, under "#include "pyuv.h"

//Must define Py_TYPE for Python 2.5 or older

ifndef Py_TYPE

define Py_TYPE(o) ((o)->ob_type)

endif

//Must define PyVarObject_HEAD_INIT for Python 2.5 or older

ifndef PyVarObject_HEAD_INIT

define PyVarObject_HEAD_INIT(type, size) \

   PyObject_HEAD_INIT(type) size,

endif

//Must define PyModule_AddIntMacro for Python 2.5 or older

ifndef PyModule_AddIntMacro

define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)

endif

//Must define PyBytes_FromStringAndSize for Python 2.5 or older

ifndef PyBytes_FromStringAndSize

define PyBytes_FromStringAndSize PyString_FromStringAndSize

endif

//Must define PyBytes_FromString for Python 2.5 or older

ifndef PyBytes_FromString

define PyBytes_FromString PyString_FromString

endif

will make it support python25 or older

@saghul
Copy link
Owner

saghul commented Jan 6, 2012

Hi,

I'm not sure if I'm willing to support this. As of right now, I have no means to test Python 2.5 unless I manually compile it myself because it's gone from the Debian (testing/unstable) repositories. It's also EOL'd.

OTOH, it's just a bunch of ifdefs, and right now I don't expect huge code changes so it should remain stable... Could you please try to pass the test suite with latest clone and if it does send a pull request with this change? :-)

Thanks!

@tanbro
Copy link
Author

tanbro commented Jan 9, 2012

Thanks!
i think py25 is not very important. py3 is more imporant ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants