Python 2.4 compatibility

#2 · closed · 3 comments

View on GitHub ↗

dgleich

The current fastb.c code is not compatible with Python < 2.5. I'm stuck with Python 2.4 on my Hadoop cluster :-(. The following diff fixes the extension. (I'm not configuring it as a fork/pull because it's so simple.) See http://bugs.python.org/issue1485576 for a discussion ``` diff --git a/fastb.c b/fastb.c index f54f20c..9fe54af 100644 --- a/fastb.c +++ b/fastb.c @@ -18,6 +18,12 @@ #include <Python.h> +#if PY_VERSION_HEX < 0x02050000 +typedef int Py_ssize_t; +#define PY_SSIZE_T_MAX INT_MAX +#define PY_SSIZE_T_MIN INT_MIN +#endif + #define BYTE_TC 1 #define BOOL_TC 2 #define INT_TC 3 ```

Comments

klbostee

Thanks, committing it as we speak!

klbostee

include snippet for compatibility with pre-2.5 interpreters (closed by 1af42f6da8e1f8375f888c6851a902865d25d6e1)

dgleich

Thanks for the prompt reply!