Skip to content

Commit 95ed3f8

Browse files
committed
Accept suggestions from new toolchain
1 parent cab7358 commit 95ed3f8

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

psplit/__init__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import fileinput
44
import math
55
import sys
6-
76
from argparse import ArgumentParser, Namespace
7+
from collections.abc import Iterable, Sequence
88
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
1112

1213
HELP = '✂️ `psplit`: Split git patch files ✂️'
1314

@@ -177,17 +178,17 @@ def _setup_directory(directory: Path, clean: bool) -> None:
177178
class _ArgumentParser(ArgumentParser):
178179
def __init__(
179180
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,
184185
is_fixer: bool = False,
185186
**kwargs: Any,
186187
) -> None:
187188
super().__init__(prog, usage, description, None, **kwargs)
188189
self._epilog = epilog
189190

190-
def exit(self, status: int = 0, message: Optional[str] = None) -> Never:
191+
def exit(self, status: int = 0, message: str | None = None) -> Never:
191192
argv = sys.argv[1:]
192193
if self._epilog and not status and ('-h' in argv or '--help' in argv):
193194
print(self._epilog)

test/test_psplit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import psplit
1111

12-
PARENT = Path(__file__).parent
12+
PARENT = Path(__file__).parent.parent
1313
PATCH_FILES = PARENT / 'patches'
1414
assert PATCH_FILES.exists()
1515
EXPECTED = PARENT / 'test_expected'

0 commit comments

Comments
 (0)