]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-133893: asyncio.graph: Replace TextIO annotation with io.Writer (GH-133894...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 11 May 2025 15:25:43 +0000 (17:25 +0200)
committerGitHub <noreply@github.com>
Sun, 11 May 2025 15:25:43 +0000 (15:25 +0000)
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>
Lib/asyncio/graph.py

index d8df7c9919abbf7f1f4c7d0fe004adf823c581ef..b5bfeb1630a1590d9698819fe17d14d9afea069e 100644 (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: