Skip to content

Commit 321137e

Browse files
authored
Merge branch '3.12' into gh-89811-3.12-backport
2 parents 4393350 + 2c9cf64 commit 321137e

File tree

342 files changed

+4106
-2268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+4106
-2268
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ jobs:
169169
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
170170
- name: Configure ccache action
171171
uses: hendrikmuhs/[email protected]
172+
with:
173+
save: false
172174
- name: Check Autoconf and aclocal versions
173175
run: |
174176
grep "Generated by GNU Autoconf 2.71" configure
@@ -283,6 +285,8 @@ jobs:
283285
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
284286
- name: Configure ccache action
285287
uses: hendrikmuhs/[email protected]
288+
with:
289+
save: false
286290
- name: Configure CPython
287291
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
288292
- name: Build CPython
@@ -326,6 +330,8 @@ jobs:
326330
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
327331
- name: Configure ccache action
328332
uses: hendrikmuhs/[email protected]
333+
with:
334+
save: false
329335
- name: Setup directory envs for out-of-tree builds
330336
run: |
331337
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
@@ -445,6 +451,9 @@ jobs:
445451
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
446452
- name: Configure ccache action
447453
uses: hendrikmuhs/[email protected]
454+
with:
455+
save: ${{ github.event_name == 'push' }}
456+
max-size: "200M"
448457
- name: Configure CPython
449458
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
450459
- name: Build CPython

.github/workflows/reusable-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
config_hash:
55
required: true
66
type: string
7-
free-threaded:
7+
free-threading:
88
required: false
99
type: boolean
1010
default: false
@@ -35,7 +35,7 @@ jobs:
3535
./configure \
3636
--config-cache \
3737
--with-pydebug \
38-
${{ inputs.free-threaded && '--disable-gil' || '' }} \
38+
${{ inputs.free-threading && '--disable-gil' || '' }} \
3939
--prefix=/opt/python-dev \
4040
--with-openssl="$(brew --prefix [email protected])"
4141
- name: Build CPython

.github/workflows/reusable-ubuntu.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
4242
- name: Configure ccache action
4343
uses: hendrikmuhs/[email protected]
44+
with:
45+
save: ${{ github.event_name == 'push' }}
46+
max-size: "200M"
4447
- name: Setup directory envs for out-of-tree builds
4548
run: |
4649
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV

.github/workflows/reusable-windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
workflow_call:
33
inputs:
4-
free-threaded:
4+
free-threading:
55
required: false
66
type: boolean
77
default: false
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Build CPython
19-
run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
19+
run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threading && '--disable-gil' || '' }}
2020
- name: Display build info
2121
run: .\python.bat -m test.pythoninfo
2222
- name: Tests
@@ -33,7 +33,7 @@ jobs:
3333
- name: Register MSVC problem matcher
3434
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3535
- name: Build CPython
36-
run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
36+
run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threading && '--disable-gil' || '' }}
3737
- name: Display build info
3838
run: .\python.bat -m test.pythoninfo
3939
- name: Tests
@@ -50,4 +50,4 @@ jobs:
5050
- name: Register MSVC problem matcher
5151
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
5252
- name: Build CPython
53-
run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
53+
run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threading && '--disable-gil' || '' }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repos:
2828
hooks:
2929
- id: sphinx-lint
3030
args: [--enable=default-role]
31-
files: ^Doc/|^Misc/NEWS.d/next/
31+
files: ^Doc/|^Misc/NEWS.d/
3232

3333
- repo: meta
3434
hooks:

Doc/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ SPHINXERRORHANDLING = -W
1919
PAPEROPT_a4 = -D latex_elements.papersize=a4paper
2020
PAPEROPT_letter = -D latex_elements.papersize=letterpaper
2121

22-
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j $(JOBS) \
23-
$(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)
22+
ALLSPHINXOPTS = -b $(BUILDER) \
23+
-d build/doctrees \
24+
-j $(JOBS) \
25+
$(PAPEROPT_$(PAPER)) \
26+
$(SPHINXOPTS) $(SPHINXERRORHANDLING) \
27+
. build/$(BUILDER) $(SOURCES)
2428

2529
.PHONY: help
2630
help:
@@ -142,7 +146,7 @@ htmlview: html
142146

143147
.PHONY: htmllive
144148
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
145-
htmllive: SPHINXOPTS = --re-ignore="/venv/"
149+
htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
146150
htmllive: html
147151

148152
.PHONY: clean

Doc/c-api/bytes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ called with a non-bytes parameter.
155155
156156
Return the null-terminated contents of the object *obj*
157157
through the output variables *buffer* and *length*.
158+
Returns ``0`` on success.
158159
159160
If *length* is ``NULL``, the bytes object
160161
may not contain embedded null bytes;

Doc/c-api/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ Querying the error indicator
427427
.. c:function:: PyObject *PyErr_GetRaisedException(void)
428428
429429
Return the exception currently being raised, clearing the error indicator at
430-
the same time.
430+
the same time. Return ``NULL`` if the error indicator is not set.
431431
432432
This function is used by code that needs to catch exceptions,
433433
or code that needs to save and restore the error indicator temporarily.

Doc/c-api/structures.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,40 @@ definition with the same method name.
399399
slot. This is helpful because calls to PyCFunctions are optimized more
400400
than wrapper object calls.
401401
402+
.. c:function:: PyObject * PyCMethod_New(PyMethodDef *ml, PyObject *self, PyObject *module, PyTypeObject *cls)
403+
404+
Turn *ml* into a Python :term:`callable` object.
405+
The caller must ensure that *ml* outlives the :term:`callable`.
406+
Typically, *ml* is defined as a static variable.
407+
408+
The *self* parameter will be passed as the *self* argument
409+
to the C function in ``ml->ml_meth`` when invoked.
410+
*self* can be ``NULL``.
411+
412+
The :term:`callable` object's ``__module__`` attribute
413+
can be set from the given *module* argument.
414+
*module* should be a Python string,
415+
which will be used as name of the module the function is defined in.
416+
If unavailable, it can be set to :const:`None` or ``NULL``.
417+
418+
.. seealso:: :attr:`function.__module__`
419+
420+
The *cls* parameter will be passed as the *defining_class*
421+
argument to the C function.
422+
Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``.
423+
424+
.. versionadded:: 3.9
425+
426+
427+
.. c:function:: PyObject * PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
428+
429+
Equivalent to ``PyCMethod_New(ml, self, module, NULL)``.
430+
431+
432+
.. c:function:: PyObject * PyCFunction_New(PyMethodDef *ml, PyObject *self)
433+
434+
Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``.
435+
402436
403437
Accessing attributes of extension types
404438
---------------------------------------

Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@
242242
# Attributes/methods/etc. that definitely should be documented better,
243243
# but are deferred for now:
244244
('py:attr', '__annotations__'),
245+
('py:meth', '__missing__'),
245246
('py:attr', '__wrapped__'),
246247
('py:meth', 'index'), # list.index, tuple.index, etc.
247248
]

0 commit comments

Comments
 (0)