-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Update math.c #360
Update math.c #360
Conversation
Replace ob_item access in math.c with macros so pygame compiles in pypy. (Thanks to Armin Rigo of Pypy for suggesting how to do this). With this change, pygame seems to work in pypy. I tried all the examples, the only problems seemed to be: Errors on any keyboard events e.g. ``` Traceback (most recent call last): File "aliens.py", line 321, in <module> if __name__ == '__main__': main() File "aliens.py", line 257, in main (event.type == KEYDOWN and event.key == K_ESCAPE): AttributeError: 'Event' object has no attribute 'key' ``` The fastevents example seemed to be frozen, all the examples displayed graphics and played sounds.
One failure is unrelated - AssertionError: Failed to access the SoundFont /usr/share/sounds/sf2/FluidR3_GM.sf2 I'm not sure why the segfault in the math tests is happening, can't reproduce it myself right now. |
Have reproduced it.. I guess not knowing the CPython API doesn't help here.. |
Fix use of PyList_SET_ITEM
My lack of C knowledge showing there. Now, all the math tests pass under pypy except
NOTE - you need to first apply the cython patch in my other pull request for this to work. |
PyList_SET_ITEM seems fine, since it's a new list. It's interesting that it gets all the way to |
I guess this |
Cheers. |
Replace ob_item access in math.c with macros so pygame compiles in pypy.
(Thanks to Armin Rigo of Pypy for suggesting how to do this).
With this change, pygame seems to work in pypy.
I tried all the examples, the only problems seemed to be:
Errors on any keyboard events e.g.
The fastevents example seemed to be frozen, all the examples displayed graphics and played sounds.