Skip to content

Conversation

cimarronm
Copy link
Contributor

Added METH_VARARGS to the method definition flags in _macosx.m as Python 3 requires METH_VARARGS to be set when METH_KEYWORDS is set. This is already the case where METH_KEYWORDS is used elsewhere, namely _ttconv.cpp and cntr.c.

Without this and executing within Python3 one will get the error
SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no longer supported!

@WeatherGod
Copy link
Member

@mdehoon , I think you would be best to comment.

@WeatherGod WeatherGod added the OSX label Feb 13, 2014
@mdehoon
Copy link
Contributor

mdehoon commented Feb 18, 2014

Seems OK for start_event_loop.
For stop_event_loop however, since the function takes no arguments, METH_NOARGS seems more appropriate.

@cimarronm
Copy link
Contributor Author

@mdehoon You're right. I had only looked at start_event_loop. That definitely should be METH_NOARGS. Update PR to include that fix as well.

@tacaswell tacaswell added this to the v1.4.x milestone Feb 18, 2014
@mdehoon
Copy link
Contributor

mdehoon commented Feb 20, 2014

Looks fine to me.

tacaswell added a commit that referenced this pull request Feb 20, 2014
Python 3 METH_VARARGS with METH_KEYWORDS
@tacaswell tacaswell merged commit bbccb5c into matplotlib:master Feb 20, 2014
@tacaswell
Copy link
Member

merged, thanks @cimarronm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants