debian/tests: py37: deferred annotations.
authorPeter Pentchev <roam@debian.org>
Fri, 12 Aug 2022 10:04:56 +0000 (13:04 +0300)
committerPeter Pentchev <roam@debian.org>
Fri, 12 Aug 2022 10:05:20 +0000 (13:05 +0300)
debian/tests/python/pychunk/common.py

index a64e4246e31f07192bc5ae99372403398e939952..a755c45bab67070370bc18d41986189e6568ed20 100644 (file)
@@ -1,5 +1,7 @@
 """Common routines for the Python zchunk tests."""
 
+from __future__ import annotations
+
 import argparse
 import dataclasses
 import os
@@ -7,7 +9,7 @@ import pathlib
 import subprocess
 import sys
 
-from typing import Callable, Dict, List
+from typing import Callable
 
 from pychunk import defs
 
@@ -17,7 +19,7 @@ class Config:
     """Common runtime configuration settings."""
 
     bindir: pathlib.Path
-    env: Dict[str, str]
+    env: dict[str, str]
 
     orig: pathlib.Path
     compressed: pathlib.Path
@@ -35,7 +37,7 @@ class Chunk:
     end: int
 
 
-def get_runenv() -> Dict[str, str]:
+def get_runenv() -> dict[str, str]:
     """Set up the environment for running the zchunk programs."""
     env = dict(os.environ)
     env["LC_ALL"] = "C.UTF-8"
@@ -97,8 +99,8 @@ def read_chunks(cfg: Config, orig_size: int, comp_size: int) -> Chunk:
         env=cfg.env,
     ).decode("UTF-8")
 
-    params: Dict[str, int] = {}
-    chunks: List[Chunk] = []
+    params: dict[str, int] = {}
+    chunks: list[Chunk] = []
 
     def ignore_till_end(line: str) -> str:
         """Ignore anything until EOF."""
@@ -196,7 +198,7 @@ def read_chunks(cfg: Config, orig_size: int, comp_size: int) -> Chunk:
 
         return "wait_for_chunk_count"
 
-    handlers: Dict[str, Callable[[str], str]] = {
+    handlers: dict[str, Callable[[str], str]] = {
         func.__name__: func
         for func in (
             wait_for_total_size,