Skip to content

Commit

Permalink
ci/lint-commit-msg: move away from things deprecated in Python 3.9
Browse files Browse the repository at this point in the history
As normal types started being supported better for type hinting,
their alternatives in the typing module would be deprecated.
  • Loading branch information
jeeb committed Nov 22, 2024
1 parent 45a72d6 commit 7f49806
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ci/lint-commit-msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
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:
sys.stdout.flush()
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):
Expand Down

0 comments on commit 7f49806

Please sign in to comment.