From cd3d5e0ea6317fbb328b0f3b397ac9d9a3158891 Mon Sep 17 00:00:00 2001 From: Peter Pentchev Date: Fri, 12 Aug 2022 13:04:56 +0300 Subject: [PATCH] debian/tests: py37: deferred annotations. --- debian/tests/python/pychunk/common.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/tests/python/pychunk/common.py b/debian/tests/python/pychunk/common.py index a64e424..a755c45 100644 --- a/debian/tests/python/pychunk/common.py +++ b/debian/tests/python/pychunk/common.py @@ -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, -- 2.30.2