Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork30
Open
Description
Consider an example:
if (((PyObject*)obj)->data==Py_None) {111;}if (Py_None== ((PyObject*)obj)->data) {111;}
Afterupgrade_pythoncapi.py
I got:
#include"pythoncapi_compat.h"if (((PyObject*)obj)->Py_IsNone(data)) {111;}if (Py_None== ((PyObject*)obj)->data) {111;}
Real world example:
https://github.com/aleaxit/gmpy/blob/eb8dfcbd84abcfcb36b4adcb0d5c6d050731dd75/src/gmpy2_xmpz_misc.c#L237
I'm not sure if this is a bug. This kind of issues is not easy to avoid, using regexps for code transformations. Have you considered to use something like thepycparser?
Thanks for the project.
Metadata
Metadata
Assignees
Labels
No labels