-
Notifications
You must be signed in to change notification settings - Fork 311
make pymssql compile in PyPy #309
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
base: master
Are you sure you want to change the base?
Conversation
Thank you very much! I'll try to look at this sometime soon, but thanks in advance for contributing! |
I've tried it out. It works in my application. It is unfortunately slower than the CPython version of the report (since both spend most of their time calling pymssql, and CPython API emulation is epically slow in PyPy) but I'm sure another program that does more significant processing on the database results would benefit. |
Yeah, unfortunately, this is the case.
|
Perhaps it is a little faster now that pypy has recently improved their PyObject support. |
I have also tried this PR on my app and it works, speed is ok. |
Building master with this patch rebased and applied required me to revert |
These changes allow pymssql to compile and work under PyPy 2.5.1. It will be slow in PyPy since it uses the C API but it is better than nothing and it is more featureful than other options I tried. To make it work I had to inherit from Exception normally and define PyByteArray_Check if it is not defined. Since PyPy doesn't seem to have bytearray it's a pretty safe bet that False is the right answer. Let me know if this affects the tests; I do not have a server I can use against the tests.
Cython also noticed this function declared with except -1 in the .pxd and except 1 in the pyx, so I changed one of them to match. I'm not sure whether -1 or +1 is the correct value.
Fixes issue #308.