Skip to content

Commit 766d6a2

Browse files
authored
Merge branch 'python:main' into fix-issue-134567
2 parents ec353d2 + bd928a3 commit 766d6a2

File tree

131 files changed

+2118
-652
lines changed

Some content is hidden

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

131 files changed

+2118
-652
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ repos:
3434
name: Run Black on Tools/jit/
3535
files: ^Tools/jit/
3636

37+
- repo: https://github.com/Lucas-C/pre-commit-hooks
38+
rev: v1.5.5
39+
hooks:
40+
- id: remove-tabs
41+
types: [python]
42+
exclude: ^Tools/c-analyzer/cpython/_parser.py
43+
3744
- repo: https://github.com/pre-commit/pre-commit-hooks
3845
rev: v5.0.0
3946
hooks:

Doc/c-api/capsule.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,19 @@ Refer to :ref:`using-capsules` for more information on using these objects.
105105
``module.attribute``. The *name* stored in the capsule must match this
106106
string exactly.
107107
108+
This function splits *name* on the ``.`` character, and imports the first
109+
element. It then processes further elements using attribute lookups.
110+
108111
Return the capsule's internal *pointer* on success. On failure, set an
109112
exception and return ``NULL``.
110113
114+
.. note::
115+
116+
If *name* points to an attribute of some submodule or subpackage, this
117+
submodule or subpackage must be previously imported using other means
118+
(for example, by using :c:func:`PyImport_ImportModule`) for the
119+
attribute lookups to succeed.
120+
111121
.. versionchanged:: 3.3
112122
*no_block* has no effect anymore.
113123

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
12501250
.. c:function:: void PyInterpreterState_Clear(PyInterpreterState *interp)
12511251
12521252
Reset all information in an interpreter state object. There must be
1253-
an :term:`attached thread state` for the the interpreter.
1253+
an :term:`attached thread state` for the interpreter.
12541254
12551255
.. audit-event:: cpython.PyInterpreterState_Clear "" c.PyInterpreterState_Clear
12561256

Doc/c-api/long.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
439439
All *n_bytes* of the buffer are written: large buffers are padded with
440440
zeroes.
441441
442-
If the returned value is greater than than *n_bytes*, the value was
442+
If the returned value is greater than *n_bytes*, the value was
443443
truncated: as many of the lowest bits of the value as could fit are written,
444444
and the higher bits are ignored. This matches the typical behavior
445445
of a C-style downcast.

Doc/extending/newtypes_tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ be an instance of a subclass.
277277
The explicit cast to ``CustomObject *`` above is needed because we defined
278278
``Custom_dealloc`` to take a ``PyObject *`` argument, as the ``tp_dealloc``
279279
function pointer expects to receive a ``PyObject *`` argument.
280-
By assigning to the the ``tp_dealloc`` slot of a type, we declare
280+
By assigning to the ``tp_dealloc`` slot of a type, we declare
281281
that it can only be called with instances of our ``CustomObject``
282282
class, so the cast to ``(CustomObject *)`` is safe.
283283
This is object-oriented polymorphism, in C!

Doc/howto/functional.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ generators:
602602
raise an exception inside the generator; the exception is raised by the
603603
``yield`` expression where the generator's execution is paused.
604604

605-
* :meth:`~generator.close` raises a :exc:`GeneratorExit` exception inside the
605+
* :meth:`~generator.close` sends a :exc:`GeneratorExit` exception to the
606606
generator to terminate the iteration. On receiving this exception, the
607607
generator's code must either raise :exc:`GeneratorExit` or
608608
:exc:`StopIteration`; catching the exception and doing anything else is

Doc/howto/isolating-extensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ Avoiding ``PyObject_New``
453453

454454
GC-tracked objects need to be allocated using GC-aware functions.
455455

456-
If you use use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:
456+
If you use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:
457457

458458
- Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible.
459459
That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::

Doc/library/ctypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2965,7 +2965,7 @@ fields, or any other data types containing pointer type fields.
29652965
.. attribute:: is_anonymous
29662966

29672967
True if this field is anonymous, that is, it contains nested sub-fields
2968-
that should be be merged into a containing structure or union.
2968+
that should be merged into a containing structure or union.
29692969

29702970

29712971
.. _ctypes-arrays-pointers:

Doc/library/email.header.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ The :mod:`email.header` module also provides the following convenient functions.
206206

207207
.. note::
208208

209-
This function exists for for backwards compatibility only. For
209+
This function exists for backwards compatibility only. For
210210
new code, we recommend using :class:`email.headerregistry.HeaderRegistry`.
211211

212212

@@ -225,5 +225,5 @@ The :mod:`email.header` module also provides the following convenient functions.
225225

226226
.. note::
227227

228-
This function exists for for backwards compatibility only, and is
228+
This function exists for backwards compatibility only, and is
229229
not recommended for use in new code.

Doc/library/exceptions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ their subgroups based on the types of the contained exceptions.
10481048
subclasses that need a different constructor signature need to
10491049
override that rather than :meth:`~object.__init__`. For example, the following
10501050
defines an exception group subclass which accepts an exit_code and
1051-
and constructs the group's message from it. ::
1051+
constructs the group's message from it. ::
10521052

10531053
class Errors(ExceptionGroup):
10541054
def __new__(cls, errors, exit_code):

0 commit comments

Comments
 (0)