steeve / python-lz4

LZ4 bindings for python
http://github.com/steeve/python-lz4
106 stars 31 forks source link

Added support for Python3. #10

Closed tr11 closed 10 years ago

tr11 commented 10 years ago

This pull request adds support for Python 3. It should fix issue #7.

steeve commented 10 years ago

Hi, Sorry for the lag I was on vacation. Thanks for your PR.

I have the impression that your patch won't work on Python <3, as the PyBytes_* functions only seem to exist in Python >= 3. Could you fix that?

tr11 commented 10 years ago

Sorry, I didn't get your comment. I tested this patch on Python 2.6, 2.7, 3.2 and 3.3. Are you referring to another version?

kislyuk commented 10 years ago

@steeve it would be nice if this could be merged. Are you asking about Python 3.0? That version is not really used widely, and its use is discouraged by the Python maintainers.

steeve commented 10 years ago

Ooops sorry I just saw your comment. I'm under the impression that _PyBytes_Resize doesn't exist on Python < 3.

Am I wrong? You seem to have tested it though.

steeve commented 10 years ago

The issue is 3 months old. This is embarrassing, sorry.

tr11 commented 10 years ago

@steeve, I'm not sure about previous Python versions, but at least for 2.6 and 2.7 the following is in the bytesobject.h header file in the python includes:

#define _PyBytes_Resize _PyString_Resize

so at least for those versions, the macro _PyBytes_Resize is defined. Not sure about the existence of this macro for python <2.6, though.

steeve commented 10 years ago

Sorry for the lag. Looks good to me. Merged!