Skip to content

Commit 99e6314

Browse files
authored
[3.11] GH-97950: Use new-style index directive ('exception') (GH-104160) (#104161)
1 parent c463796 commit 99e6314

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Doc/reference/expressions.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ An identifier occurring as an atom is a name. See section :ref:`identifiers`
7171
for lexical definition and section :ref:`naming` for documentation of naming and
7272
binding.
7373

74-
.. index:: exception: NameError
74+
.. index:: pair: exception; NameError
7575

7676
When the name is bound to an object, evaluation of the atom yields that object.
7777
When a name is not bound, an attempt to evaluate it raises a :exc:`NameError`
@@ -534,7 +534,7 @@ be used to control the execution of a generator function.
534534
Note that calling any of the generator methods below when the generator
535535
is already executing raises a :exc:`ValueError` exception.
536536

537-
.. index:: exception: StopIteration
537+
.. index:: pair: exception; StopIteration
538538

539539

540540
.. method:: generator.__next__()
@@ -584,7 +584,7 @@ is already executing raises a :exc:`ValueError` exception.
584584
:attr:`~BaseException.__traceback__` attribute stored in *value* may
585585
be cleared.
586586

587-
.. index:: exception: GeneratorExit
587+
.. index:: pair: exception; GeneratorExit
588588

589589

590590
.. method:: generator.close()
@@ -706,7 +706,7 @@ This subsection describes the methods of an asynchronous generator iterator,
706706
which are used to control the execution of a generator function.
707707

708708

709-
.. index:: exception: StopAsyncIteration
709+
.. index:: pair: exception; StopAsyncIteration
710710

711711
.. coroutinemethod:: agen.__anext__()
712712

@@ -752,7 +752,7 @@ which are used to control the execution of a generator function.
752752
raises a different exception, then when the awaitable is run that exception
753753
propagates to the caller of the awaitable.
754754

755-
.. index:: exception: GeneratorExit
755+
.. index:: pair: exception; GeneratorExit
756756

757757

758758
.. coroutinemethod:: agen.aclose()
@@ -799,7 +799,7 @@ An attribute reference is a primary followed by a period and a name:
799799
attributeref: `primary` "." `identifier`
800800

801801
.. index::
802-
exception: AttributeError
802+
pair: exception; AttributeError
803803
pair: object; module
804804
pair: object; list
805805

@@ -1230,7 +1230,7 @@ applies to integral numbers or to custom objects that override the
12301230

12311231

12321232

1233-
.. index:: exception: TypeError
1233+
.. index:: pair: exception; TypeError
12341234

12351235
In all three cases, if the argument does not have the proper type, a
12361236
:exc:`TypeError` exception is raised.
@@ -1277,7 +1277,7 @@ builtin Python types implement this operator.
12771277
.. versionadded:: 3.5
12781278

12791279
.. index::
1280-
exception: ZeroDivisionError
1280+
pair: exception; ZeroDivisionError
12811281
single: division
12821282
pair: operator; / (slash)
12831283
pair: operator; //
@@ -1366,7 +1366,7 @@ the left or right by the number of bits given by the second argument.
13661366
This operation can be customized using the special :meth:`__lshift__` and
13671367
:meth:`__rshift__` methods.
13681368

1369-
.. index:: exception: ValueError
1369+
.. index:: pair: exception; ValueError
13701370

13711371
A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A left
13721372
shift by *n* bits is defined as multiplication with ``pow(2,n)``.

Doc/reference/simple_stmts.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ The extended form, ``assert expression1, expression2``, is equivalent to ::
398398

399399
.. index::
400400
single: __debug__
401-
exception: AssertionError
401+
pair: exception; AssertionError
402402

403403
These equivalences assume that :const:`__debug__` and :exc:`AssertionError` refer to
404404
the built-in variables with those names. In the current implementation, the
@@ -521,7 +521,7 @@ The :keyword:`!yield` statement
521521
single: generator; function
522522
single: generator; iterator
523523
single: function; generator
524-
exception: StopIteration
524+
pair: exception; StopIteration
525525

526526
.. productionlist:: python-grammar
527527
yield_stmt: `yield_expression`
@@ -731,7 +731,7 @@ The :keyword:`!import` statement
731731
pair: name; binding
732732
pair: keyword; from
733733
pair: keyword; as
734-
exception: ImportError
734+
pair: exception; ImportError
735735
single: , (comma); import statement
736736

737737
.. productionlist:: python-grammar

Doc/tools/extensions/pyspecific.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def patch_pairindextypes(app) -> None:
698698
pairindextypes.pop('keyword', None)
699699
pairindextypes.pop('operator', None)
700700
pairindextypes.pop('object', None)
701-
# pairindextypes.pop('exception', None)
701+
pairindextypes.pop('exception', None)
702702
# pairindextypes.pop('statement', None)
703703
# pairindextypes.pop('builtin', None)
704704

0 commit comments

Comments
 (0)