summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/graph.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-05-11 15:25:43 (GMT)
committerGitHub <noreply@github.com>2025-05-11 15:25:43 (GMT)
commit507715d5f73a2b8e04b76303fad27a16d200181c (patch)
treec4b657c4ce4dd50f327fc1bac0faa9dd0204d6b1 /Lib/asyncio/graph.py
parent98ef4837ecb1f68af5f2ab073e9451bdb3b57af0 (diff)
downloadcpython-507715d5f73a2b8e04b76303fad27a16d200181c.zip
cpython-507715d5f73a2b8e04b76303fad27a16d200181c.tar.gz
cpython-507715d5f73a2b8e04b76303fad27a16d200181c.tar.bz2
[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 1d3eacedb8cc51256a5350c6d421fb85e2b21f18) Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Diffstat (limited to 'Lib/asyncio/graph.py')
-rw-r--r--Lib/asyncio/graph.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/asyncio/graph.py b/Lib/asyncio/graph.py
index d8df7c9..b5bfeb1 100644
--- a/Lib/asyncio/graph.py
+++ b/Lib/asyncio/graph.py
@@ -1,6 +1,7 @@
"""Introspection utils for tasks call graphs."""
import dataclasses
+import io
import sys
import types
@@ -16,9 +17,6 @@ __all__ = (
'FutureCallGraph',
)
-if False: # for type checkers
- from typing import TextIO
-
# Sadly, we can't re-use the traceback module's datastructures as those
# are tailored for error reporting, whereas we need to represent an
# async call graph.
@@ -270,7 +268,7 @@ def print_call_graph(
future: futures.Future | None = None,
/,
*,
- file: TextIO | None = None,
+ file: io.Writer[str] | None = None,
depth: int = 1,
limit: int | None = None,
) -> None: