This is an archive of the discontinued Mercurial Phabricator instance.

cext: add Python 3.10 support
ClosedPublic

Authored by marmoute on Jan 18 2021, 12:30 PM.

Details

Summary
  • Replace "Py_TYPE(obj) = type;" with "Py_SET_TYPE(obj, type);"
  • Add pythoncapi_compat.h header file to get Py_SET_TYPE() on Python 2.7-3.8. Header file added to mercurial/ and contrib/python-zstandard/zstd/common/.

In Python 3.10, Py_TYPE(obj) must not longer be used as an l-value.

pythoncapi_compat.h comes from:
https://github.com/pythoncapi/pythoncapi_compat

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

marmoute created this revision.Jan 18 2021, 12:30 PM

I phabsent this in behalf of Victor to avoid him premature exposure to phabricator crapiness.

Alphare accepted this revision.Jan 22 2021, 8:31 AM
Alphare added a subscriber: Alphare.

Thanks Victor ;)

pulkit added a subscriber: pulkit.Jan 22 2021, 11:36 AM

The contrib/zstandard/ changes should be dropped from this patch. IIRC, Victor already created a PR for that.

durin42 requested changes to this revision.

Yes, please remove the python-zstandard changes from here, and send them directly to @indygreg upstream for that.

This revision now requires changes to proceed.Jan 22 2021, 2:54 PM

Yes, please remove the python-zstandard changes from here, and send them directly to @indygreg upstream for that.

We'll need to take the zstandard patches.

I already applied them upstream. However, I also dropped Python 2.7 support. So the vendored zstandard won't be updated until we drop Python 2.7.

Do you think we should go ahead and apply the local patch then until we can update the vendored copy?

Do you think we should go ahead and apply the local patch then until we can update the vendored copy?

Yes.

This revision was not accepted when it landed; it landed in state Needs Revision.
This revision was automatically updated to reflect the committed changes.