Skip to content

Commit 0e19da0

Browse files
committed
asyncio.graph: Replace TextIO annotation with io.Writer
1 parent 13cb8ca commit 0e19da0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/asyncio/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
)
1818

1919
if False: # for type checkers
20-
from typing import TextIO
20+
from io import Writer
2121

2222
# Sadly, we can't re-use the traceback module's datastructures as those
2323
# are tailored for error reporting, whereas we need to represent an
@@ -270,7 +270,7 @@ def print_call_graph(
270270
future: futures.Future | None = None,
271271
/,
272272
*,
273-
file: TextIO | None = None,
273+
file: Writer[str] | None = None,
274274
depth: int = 1,
275275
limit: int | None = None,
276276
) -> None:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Use protocol :class:`io.Writer` as annotation for
2+
:func:`asyncio.graph.format_call_graph()`'s ``file`` argument instead of
3+
:class:`typing.TextIO`.

0 commit comments

Comments
 (0)