This is an archive of the discontinued Mercurial Phabricator instance.

cext: use modern buffer protocol in patches()
ClosedPublic

Authored by indygreg on Oct 2 2018, 4:14 PM.

Details

Summary

PyObject_AsCharBuffer() is part of the "Old Buffer Protocol," which
has been deprecated for years. Let's port away from it.

PyBuffer_GetBuffer() must be paired with PyBuffer_Release(), hence the
added "goto cleanup" in a failure case.

We don't bump the extension version because the API has not changed.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Oct 2 2018, 4:14 PM
This revision was automatically updated to reflect the committed changes.