Commit e3580733 authored by kiilerix's avatar kiilerix
Browse files

cext: fix Python 3.11 compatibility - Py_SIZE is not an lvalue (issue6610)

Py_SIZE was made a static inline function during Python 3.10 development, as
described on https://vstinner.github.io/c-api-opaque-structures.html .
e92ca942ddca updated the Mercurial code base accordingly, but somehow missed a
couple of cases introduced long time ago in a8c948ee3668.

The Python change was dropped for 3.10, but is coming back again in 3.11 .
parent e74c15bd58ee
Pipeline #29254 failed with stages
in 40 minutes and 4 seconds
......@@ -176,7 +176,7 @@
if (newobj) {
assert(PyBytes_Check(newobj));
Py_SIZE(newobj)--;
Py_SET_SIZE(newobj, Py_SIZE(newobj) - 1);
_encodedir(PyBytes_AS_STRING(newobj), newlen, path, len + 1);
}
......@@ -791,7 +791,7 @@
if (newobj) {
assert(PyBytes_Check(newobj));
Py_SIZE(newobj)--;
Py_SET_SIZE(newobj, Py_SIZE(newobj) - 1);
basicencode(PyBytes_AS_STRING(newobj), newlen, path,
len + 1);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment