From 7f49806cf4986226ea8ad24c9382bca5e33daadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ekstr=C3=B6m?= Date: Fri, 22 Nov 2024 20:21:03 +0200 Subject: [PATCH] ci/lint-commit-msg: move away from things deprecated in Python 3.9 As normal types started being supported better for type hinting, their alternatives in the typing module would be deprecated. --- ci/lint-commit-msg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/lint-commit-msg.py b/ci/lint-commit-msg.py index a6ed9ecc41..7adefb5be3 100755 --- a/ci/lint-commit-msg.py +++ b/ci/lint-commit-msg.py @@ -4,7 +4,8 @@ import os import re import subprocess import sys -from typing import Callable, Dict, Optional, Tuple +from collections.abc import Callable +from typing import Optional def call(cmd) -> str: @@ -12,7 +13,7 @@ def call(cmd) -> str: ret = subprocess.run(cmd, check=True, stdout=subprocess.PIPE, text=True) return ret.stdout -lint_rules: Dict[str, Tuple[Callable, str]] = {} +lint_rules: dict[str, tuple[Callable, str]] = {} # A lint rule should return True if everything is okay def lint_rule(description: str):