pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.11k stars 2.05k forks source link

chore: use new PyCode API on Python 3.12 #4916

Closed cyyever closed 8 months ago

cyyever commented 8 months ago

This PR replaces PyObject_GetAttrString with PyCode_GetVarnames which is found by a warning of casting ''_object'' to "PyCodeObject". It also fixes an object leak which was found by code review.

Suggested changelog entry:

* Use new PyCode API on Python 3.12+
rwgk commented 8 months ago

Looks good, GHA pass, but I see you marked it as draft. Is there more you want to do here?

cyyever commented 8 months ago

Looks good, GHA pass, but I see you marked it as draft. Is there more you want to do here?

I am checking more possible replacements of PyCode like this.

cyyever commented 8 months ago

@rwgk Nothing to add, can review again?

rwgk commented 8 months ago

Thank you @cyyever!