Skip to content

Commit 3e7995c

Browse files
authored
GH-97950: Use new-style index directive ('exception') (#104160)
1 parent 83751bb commit 3e7995c

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__()
@@ -589,7 +589,7 @@ is already executing raises a :exc:`ValueError` exception.
589589
The second signature \(type\[, value\[, traceback\]\]\) is deprecated and
590590
may be removed in a future version of Python.
591591

592-
.. index:: exception: GeneratorExit
592+
.. index:: pair: exception; GeneratorExit
593593

594594

595595
.. method:: generator.close()
@@ -711,7 +711,7 @@ This subsection describes the methods of an asynchronous generator iterator,
711711
which are used to control the execution of a generator function.
712712

713713

714-
.. index:: exception: StopAsyncIteration
714+
.. index:: pair: exception; StopAsyncIteration
715715

716716
.. coroutinemethod:: agen.__anext__()
717717

@@ -763,7 +763,7 @@ which are used to control the execution of a generator function.
763763
The second signature \(type\[, value\[, traceback\]\]\) is deprecated and
764764
may be removed in a future version of Python.
765765

766-
.. index:: exception: GeneratorExit
766+
.. index:: pair: exception; GeneratorExit
767767

768768

769769
.. coroutinemethod:: agen.aclose()
@@ -810,7 +810,7 @@ An attribute reference is a primary followed by a period and a name:
810810
attributeref: `primary` "." `identifier`
811811

812812
.. index::
813-
exception: AttributeError
813+
pair: exception; AttributeError
814814
pair: object; module
815815
pair: object; list
816816

@@ -1241,7 +1241,7 @@ applies to integral numbers or to custom objects that override the
12411241

12421242

12431243

1244-
.. index:: exception: TypeError
1244+
.. index:: pair: exception; TypeError
12451245

12461246
In all three cases, if the argument does not have the proper type, a
12471247
:exc:`TypeError` exception is raised.
@@ -1288,7 +1288,7 @@ builtin Python types implement this operator.
12881288
.. versionadded:: 3.5
12891289

12901290
.. index::
1291-
exception: ZeroDivisionError
1291+
pair: exception; ZeroDivisionError
12921292
single: division
12931293
pair: operator; / (slash)
12941294
pair: operator; //
@@ -1377,7 +1377,7 @@ the left or right by the number of bits given by the second argument.
13771377
This operation can be customized using the special :meth:`__lshift__` and
13781378
:meth:`__rshift__` methods.
13791379

1380-
.. index:: exception: ValueError
1380+
.. index:: pair: exception; ValueError
13811381

13821382
A right shift by *n* bits is defined as floor division by ``pow(2,n)``. A left
13831383
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
@@ -693,7 +693,7 @@ def patch_pairindextypes(app) -> None:
693693
pairindextypes.pop('keyword', None)
694694
pairindextypes.pop('operator', None)
695695
pairindextypes.pop('object', None)
696-
# pairindextypes.pop('exception', None)
696+
pairindextypes.pop('exception', None)
697697
# pairindextypes.pop('statement', None)
698698
# pairindextypes.pop('builtin', None)
699699

0 commit comments

Comments
 (0)