Skip to content

Commit afa1cb8

Browse files
committed
style: remove Union
1 parent 424e277 commit afa1cb8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

commitizen/cmd.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
from __future__ import annotations
2+
13
import os
24
import subprocess
35
from collections.abc import Mapping
4-
from typing import NamedTuple, Union
6+
from typing import NamedTuple
57

68
from charset_normalizer import from_bytes
79

@@ -29,7 +31,7 @@ def _try_decode(bytes_: bytes) -> str:
2931
raise CharacterSetDecodeError() from e
3032

3133

32-
def run(cmd: str, env: Union[Mapping[str, str], None] = None) -> Command:
34+
def run(cmd: str, env: Mapping[str, str] | None = None) -> Command:
3335
if env is not None:
3436
env = {**os.environ, **env}
3537
process = subprocess.Popen(

commitizen/cz/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import os
22
import re
33
import tempfile
4-
from typing import Union
54

65
from commitizen import git
76
from commitizen.cz import exceptions
87

98
_RE_LOCAL_VERSION = re.compile(r"\+.+")
109

1110

12-
def required_validator(answer: str, msg: Union[str, None] = None) -> str:
11+
def required_validator(answer: str, msg: object = None) -> str:
1312
if not answer:
1413
raise exceptions.AnswerRequiredError(msg)
1514
return answer

0 commit comments

Comments
 (0)