From 3b9d10b0316cdc2679ccad80563b7c7da3951388 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 14 Sep 2023 19:33:18 +0100 Subject: gh-109413: libregrtest: Add and improve type annotations (#109405) --- Lib/test/libregrtest/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Lib/test/libregrtest/utils.py') diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index 880cec5cc50..2f3bc3c6019 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -10,6 +10,7 @@ import sys import sysconfig import tempfile import textwrap +from collections.abc import Callable from test import support from test.support import os_helper @@ -67,7 +68,7 @@ def format_duration(seconds): return ' '.join(parts) -def strip_py_suffix(names: list[str]): +def strip_py_suffix(names: list[str] | None) -> None: if not names: return for idx, name in enumerate(names): @@ -441,6 +442,7 @@ def remove_testfn(test_name: TestName, verbose: int) -> None: if not os.path.exists(name): return + nuker: Callable[[str], None] if os.path.isdir(name): import shutil kind, nuker = "directory", shutil.rmtree -- cgit v1.2.3