|
3 | 3 | import fileinput |
4 | 4 | import math |
5 | 5 | import sys |
6 | | - |
7 | 6 | from argparse import ArgumentParser, Namespace |
| 7 | +from collections.abc import Iterable, Sequence |
8 | 8 | from pathlib import Path |
9 | | -from typing import Any, Iterable, Optional, Sequence |
10 | | -from typing_extensions import Never, TypeAlias |
| 9 | +from typing import Any, TypeAlias |
| 10 | + |
| 11 | +from typing_extensions import Never |
11 | 12 |
|
12 | 13 | HELP = '✂️ `psplit`: Split git patch files ✂️' |
13 | 14 |
|
@@ -177,17 +178,17 @@ def _setup_directory(directory: Path, clean: bool) -> None: |
177 | 178 | class _ArgumentParser(ArgumentParser): |
178 | 179 | def __init__( |
179 | 180 | self, |
180 | | - prog: Optional[str] = None, |
181 | | - usage: Optional[str] = None, |
182 | | - description: Optional[str] = HELP, |
183 | | - epilog: Optional[str] = EPILOG, |
| 181 | + prog: str | None = None, |
| 182 | + usage: str | None = None, |
| 183 | + description: str | None = HELP, |
| 184 | + epilog: str | None = EPILOG, |
184 | 185 | is_fixer: bool = False, |
185 | 186 | **kwargs: Any, |
186 | 187 | ) -> None: |
187 | 188 | super().__init__(prog, usage, description, None, **kwargs) |
188 | 189 | self._epilog = epilog |
189 | 190 |
|
190 | | - def exit(self, status: int = 0, message: Optional[str] = None) -> Never: |
| 191 | + def exit(self, status: int = 0, message: str | None = None) -> Never: |
191 | 192 | argv = sys.argv[1:] |
192 | 193 | if self._epilog and not status and ('-h' in argv or '--help' in argv): |
193 | 194 | print(self._epilog) |
|
0 commit comments