Skip to content

Commit 21f9ea9

Browse files
committed
Address picnixz' feedback
1 parent 03ed5c1 commit 21f9ea9

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

Doc/library/asyncio-graph.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ a suspended *future*. These utilities and the underlying machinery
1717
can be used by users in their Python code or by external profilers
1818
and debuggers.
1919

20-
.. versionadded:: 3.14
20+
.. versionadded:: next
2121

2222

2323
.. function:: print_call_graph(*, future=None, file=None, depth=1)
@@ -44,11 +44,11 @@ and debuggers.
4444
import asyncio
4545
4646
async def test():
47-
asyncio.print_call_graph()
47+
asyncio.print_call_graph()
4848
4949
async def main():
50-
async with asyncio.TaskGroup() as g:
51-
g.create_task(test())
50+
async with asyncio.TaskGroup() as g:
51+
g.create_task(test())
5252
5353
asyncio.run(main())
5454
@@ -77,23 +77,23 @@ and debuggers.
7777
current task, the function returns ``None``.
7878

7979
If the function is called on *the current task*, the optional
80-
keyword-only ``depth`` argument can be used to skip the specified
80+
keyword-only *depth* argument can be used to skip the specified
8181
number of frames from top of the stack.
8282

8383
Returns a ``FutureCallGraph`` data class object:
8484

8585
* ``FutureCallGraph(future, call_stack, awaited_by)``
8686

87-
Where 'future' is a reference to a *Future* or a *Task*
88-
(or their subclasses.)
87+
Where *future* is a reference to a :class:`Future` or
88+
a :class:`Task` (or their subclasses.)
8989

9090
``call_stack`` is a list of ``FrameCallGraphEntry`` objects.
9191

9292
``awaited_by`` is a list of ``FutureCallGraph`` objects.
9393

9494
* ``FrameCallGraphEntry(frame)``
9595

96-
Where ``frame`` is a frame object of a regular Python function
96+
Where *frame* is a frame object of a regular Python function
9797
in the call stack.
9898

9999

@@ -102,7 +102,7 @@ Low level utility functions
102102

103103
To introspect an async call graph asyncio requires cooperation from
104104
control flow structures, such as :func:`shield` or :class:`TaskGroup`.
105-
Any time an intermediate ``Future`` object with low-level APIs like
105+
Any time an intermediate :class:`Future` object with low-level APIs like
106106
:meth:`Future.add_done_callback() <asyncio.Future.add_done_callback>` is
107107
involved, the following two functions should be used to inform *asyncio*
108108
about how exactly such intermediate future objects are connected with
@@ -114,11 +114,11 @@ the tasks they wrap or control.
114114
Record that *future* is awaited on by *waiter*.
115115

116116
Both *future* and *waiter* must be instances of
117-
:class:`asyncio.Future <Future>` or :class:`asyncio.Task <Task>` or
118-
their subclasses, otherwise the call would have no effect.
117+
:class:`Future` or :class:`Task` or their subclasses,
118+
otherwise the call would have no effect.
119119

120120
A call to ``future_add_to_awaited_by()`` must be followed by an
121-
eventual call to the ``future_discard_from_awaited_by()`` function
121+
eventual call to the :func:`future_discard_from_awaited_by` function
122122
with the same arguments.
123123

124124

@@ -127,5 +127,5 @@ the tasks they wrap or control.
127127
Record that *future* is no longer awaited on by *waiter*.
128128

129129
Both *future* and *waiter* must be instances of
130-
:class:`asyncio.Future <Future>` or :class:`asyncio.Task <Task>` or
131-
their subclasses, otherwise the call would have no effect.
130+
:class:`Future` or :class:`Task` or their subclasses, otherwise
131+
the call would have no effect.

Doc/library/inspect.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ attributes (see :ref:`import-mod-attrs` for module attributes):
316316

317317
Add ``__builtins__`` attribute to functions.
318318

319-
.. versionchanged:: 3.14
319+
.. versionchanged:: next
320320

321321
Add ``f_generator`` attribute to frames.
322322

Include/internal/pycore_debug_offsets.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extern "C" {
1616
#endif
1717

1818
// Macros to burn global values in custom sections so out-of-process
19-
// profilers can locate them easily
19+
// profilers can locate them easily.
2020

2121
#define GENERATE_DEBUG_SECTION(name, declaration) \
2222
_GENERATE_DEBUG_SECTION_WINDOWS(name) \

Lib/asyncio/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
from .events import *
1111
from .exceptions import *
1212
from .futures import *
13+
from .graph import *
1314
from .locks import *
1415
from .protocols import *
1516
from .runners import *
1617
from .queues import *
17-
from .graph import *
1818
from .streams import *
1919
from .subprocess import *
2020
from .tasks import *
@@ -28,11 +28,11 @@
2828
events.__all__ +
2929
exceptions.__all__ +
3030
futures.__all__ +
31+
graph.__all__ +
3132
locks.__all__ +
3233
protocols.__all__ +
3334
runners.__all__ +
3435
queues.__all__ +
35-
graph.__all__ +
3636
streams.__all__ +
3737
subprocess.__all__ +
3838
tasks.__all__ +

Objects/frameobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,8 +1683,7 @@ static PyObject *
16831683
frame_getgenerator(PyFrameObject *f, void *arg) {
16841684
if (f->f_frame->owner == FRAME_OWNED_BY_GENERATOR) {
16851685
PyObject *gen = (PyObject *)_PyGen_GetGeneratorFromFrame(f->f_frame);
1686-
Py_INCREF(gen);
1687-
return gen;
1686+
return Py_NewRef(gen);
16881687
}
16891688
Py_RETURN_NONE;
16901689
}

0 commit comments

Comments
 (0)