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

Python 2.4 compatibility #2

Closed
dgleich opened this issue Nov 17, 2010 · 3 comments
Closed

Python 2.4 compatibility #2

dgleich opened this issue Nov 17, 2010 · 3 comments

Comments

@dgleich
Copy link

dgleich commented Nov 17, 2010

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
@klbostee
Copy link
Owner

Thanks, committing it as we speak!

@klbostee
Copy link
Owner

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

@dgleich
Copy link
Author

dgleich commented Nov 17, 2010

Thanks for the prompt reply!

This issue was closed.
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