Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#83 pywin32 for PyPy

open
nobody
None
5
2011-03-25
2011-03-25
No

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);"

Discussion

  • Mark Hammond
    Mark Hammond
    2011-03-26

    Sounds great to me. Use of PyObject_Init sounds good too so long as it also works in earlier Python version (I seem to recall that function was added in later versions).

     
  • PyObject_Init is already present in Python2.2

     
  • Thibault Hild
    Thibault Hild
    2012-06-21

    What is the current status of pypy compatibility ?
    Is the work done by Amaury on https://bitbucket.org/amauryfa/pywin32-pypy going to be merged back in the pywin32 project ?

     
  • Matti Picus
    Matti Picus
    2012-07-18

    How can I help get this merged into default pywin32 ?

     
  • Mark Hammond
    Mark Hammond
    2012-07-18

    I guess you could contact Amaury and see if he needs any help to get patches together for review - from my POV, I'm just waiting for those patches.