gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (#133894)

This commit is contained in:
Sebastian Rittau 2025-05-11 16:59:56 +02:00 committed by GitHub
parent 13cb8ca3da
commit 1d3eacedb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: