mirror of
https://github.com/python/cpython.git
synced 2025-09-23 17:03:23 +00:00
[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 1d3eacedb8
)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
parent
98ef4837ec
commit
507715d5f7
1 changed files with 2 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
"""Introspection utils for tasks call graphs."""
|
"""Introspection utils for tasks call graphs."""
|
||||||
|
|
||||||
import dataclasses
|
import dataclasses
|
||||||
|
import io
|
||||||
import sys
|
import sys
|
||||||
import types
|
import types
|
||||||
|
|
||||||
|
@ -16,9 +17,6 @@ __all__ = (
|
||||||
'FutureCallGraph',
|
'FutureCallGraph',
|
||||||
)
|
)
|
||||||
|
|
||||||
if False: # for type checkers
|
|
||||||
from typing import TextIO
|
|
||||||
|
|
||||||
# Sadly, we can't re-use the traceback module's datastructures as those
|
# Sadly, we can't re-use the traceback module's datastructures as those
|
||||||
# are tailored for error reporting, whereas we need to represent an
|
# are tailored for error reporting, whereas we need to represent an
|
||||||
# async call graph.
|
# async call graph.
|
||||||
|
@ -270,7 +268,7 @@ def print_call_graph(
|
||||||
future: futures.Future | None = None,
|
future: futures.Future | None = None,
|
||||||
/,
|
/,
|
||||||
*,
|
*,
|
||||||
file: TextIO | None = None,
|
file: io.Writer[str] | None = None,
|
||||||
depth: int = 1,
|
depth: int = 1,
|
||||||
limit: int | None = None,
|
limit: int | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue