diff options
author | Sebastian Rittau <srittau@rittau.biz> | 2025-05-11 16:59:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-11 17:59:56 +0300 |
commit | 1d3eacedb8cc51256a5350c6d421fb85e2b21f18 (patch) | |
tree | 51a5f0376b63a72bd9b9a11f6a22233335eeefd6 | |
parent | 13cb8ca3da75d6fe2a1114e58c24ca681fee411f (diff) | |
download | cpython-1d3eacedb8cc51256a5350c6d421fb85e2b21f18.tar.gz cpython-1d3eacedb8cc51256a5350c6d421fb85e2b21f18.zip |
gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (#133894)
-rw-r--r-- | Lib/asyncio/graph.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/asyncio/graph.py b/Lib/asyncio/graph.py index d8df7c9919a..b5bfeb1630a 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: |