Skip to content

Commit 507715d

Browse files
[3.14] gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (GH-133894) (#133901)
gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (GH-133894) (cherry picked from commit 1d3eace) Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
1 parent 98ef483 commit 507715d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/asyncio/graph.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Introspection utils for tasks call graphs."""
22

33
import dataclasses
4+
import io
45
import sys
56
import types
67

@@ -16,9 +17,6 @@
1617
'FutureCallGraph',
1718
)
1819

19-
if False: # for type checkers
20-
from typing import TextIO
21-
2220
# Sadly, we can't re-use the traceback module's datastructures as those
2321
# are tailored for error reporting, whereas we need to represent an
2422
# async call graph.
@@ -270,7 +268,7 @@ def print_call_graph(
270268
future: futures.Future | None = None,
271269
/,
272270
*,
273-
file: TextIO | None = None,
271+
file: io.Writer[str] | None = None,
274272
depth: int = 1,
275273
limit: int | None = None,
276274
) -> None:

0 commit comments

Comments
 (0)