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 .
17 jobs for branch/stable in 40 minutes and 4 seconds (queued for 3 seconds)
Name Stage Failure
failed
test-py3 Tests
Skipped test-rhg.t: missing feature: running with rhg as 'hg'
Skipped test-sparse-fsmonitor.t: skipped
Skipped test-sparse-revlog.t: missing artifact, run "/tmp/mercurial-ci/tests/artifacts/scripts/generate-churning-bundle.py"
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Failed test-shelve2.t#phasebased#abortflag#continuecommand: output changed
# Ran 918 tests, 61 skipped, 1 failed.
python hash seed: 68844598
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
test-py2 Tests
Skipped test-rhg.t: missing feature: running with rhg as 'hg'
Skipped test-sparse-fsmonitor.t: skipped
Skipped test-sparse-revlog.t: missing artifact, run "/tmp/mercurial-ci/tests/artifacts/scripts/generate-churning-bundle.py"
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Failed test-issue6528.t: output changed
# Ran 924 tests, 55 skipped, 1 failed.
python hash seed: 3910696348
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
windows-py3-pyox Tests
Skipped test-update-atomic.t: missing feature: unix-style permissions
Skipped test-update-issue1456.t: missing feature: executable bit
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Skipped test-wireproto-exchangev2-shallow.t: missing feature: sqlite3 module and matching cli is available
Failed test-subrepo-recursion.t: returned error code 4294967295
# Ran 838 tests, 141 skipped, 1 failed.
python hash seed: 2911391498
Cleaning up file based variables
ERROR: Job failed: exit status 1
failed
windows-py3 Tests
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Icontrib\python-zstandard\zstd\common -Icontrib\python-zstandard\zstd\compress -Icontrib\python-zstandard\c-ext -Icontrib\python-zstandard\zstd\dictBuilder -Icontrib\python-zstandard\zstd\decompress -Icontrib\python-zstandard\zstd -IC:\Program Files\Python39\include -IC:\Program Files\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /Tccontrib\python-zstandard\zstd\dictBuilder\zdict.c /FoC:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\dictBuilder\zdict.obj -DZSTD_MULTITHREAD -DZSTDLIB_VISIBILITY= -DZDICTLIB_VISIBILITY= -DZSTDERRORLIB_VISIBILITY=
zdict.c
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Program Files\Python39\libs /LIBPATH:C:\Program Files\Python39\PCbuild\amd64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29910\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64 /EXPORT:PyInit_zstd C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\bufferutil.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\compressionchunker.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\compressiondict.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\compressionparams.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\compressionreader.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\compressionwriter.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\compressobj.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\compressor.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\compressoriterator.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\constants.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\decompressionreader.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\decompressionwriter.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\decompressobj.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\decompressor.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\decompressoriterator.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\frameparams.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\common\debug.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\common\entropy_common.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\common\error_private.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\common\fse_decompress.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\common\pool.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\common\threading.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\common\xxhash.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\common\zstd_common.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\fse_compress.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\hist.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\huf_compress.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstd_compress.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstd_compress_literals.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstd_compress_sequences.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstd_double_fast.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstd_fast.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstd_lazy.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstd_ldm.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstd_opt.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\compress\zstdmt_compress.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\decompress\huf_decompress.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\decompress\zstd_ddict.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\decompress\zstd_decompress.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\decompress\zstd_decompress_block.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\dictBuilder\cover.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\dictBuilder\divsufsort.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\dictBuilder\fastcover.obj C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\zstd\dictBuilder\zdict.obj /OUT:C:\Temp\hgtests.pbv2niq3\build\lib.win-amd64-3.9\mercurial\zstd.cp39-win_amd64.pyd /IMPLIB:C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\zstd.cp39-win_amd64.lib
Creating library C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\zstd.cp39-win_amd64.lib and object C:\Temp\hgtests.pbv2niq3\build\temp.win-amd64-3.9\Release\contrib\python-zstandard\c-ext\zstd.cp39-win_amd64.exp
Generating code
Finished generating code
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\link.exe' failed with exit code 1158
Cleaning up file based variables
ERROR: Job failed: exit status 1