I've just managed to make pywin32 compile and work on top of PyPy.
I open this ticket to keep track of the various changes that I made to the pywin32 source code.
I'm currently preparing patches; for the moment, changes are of two kinds:
- In some .cpp files you can find "if PyString_Check(xxx)" without surrounding parentheses. This works on CPython because PyString_Check is actually a macro which adds parentheses to its expression; with PyPy PyString_Check is a function.
- With PyPy it's not allowed to change ob_type after object creation. This is used a lot by all PyIBase subclasses. The solution I found is to pass the TypeObject to the base constructor, and ensure that ob_type is set just before calling _Py_NewReference(). Of course these two lines can be replaced by "PyObject_Init(this, type);"
Log in to post a comment.