Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#57)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 7, 2023
1 parent 0208cdf commit 5fbf14a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
args: ["--py37-plus", "--keep-runtime-typing"]

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black
exclude: "tests/test_catch_py311.py"
Expand Down
14 changes: 8 additions & 6 deletions src/exceptiongroup/_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ def split(
__condition: type[_BaseExceptionT]
| tuple[type[_BaseExceptionT], ...]
| Callable[[_BaseExceptionT_co], bool],
) -> tuple[BaseExceptionGroup[_BaseExceptionT] | None, Self | None] | tuple[
Self | None, Self | None
]:
) -> (
tuple[BaseExceptionGroup[_BaseExceptionT] | None, Self | None]
| tuple[Self | None, Self | None]
):
condition = get_condition_filter(__condition)
if condition(self):
return self, None
Expand Down Expand Up @@ -274,7 +275,8 @@ def split(
__condition: type[_ExceptionT]
| tuple[type[_ExceptionT], ...]
| Callable[[_ExceptionT_co], bool],
) -> tuple[ExceptionGroup[_ExceptionT] | None, Self | None] | tuple[
Self | None, Self | None
]:
) -> (
tuple[ExceptionGroup[_ExceptionT] | None, Self | None]
| tuple[Self | None, Self | None]
):
return super().split(__condition)
4 changes: 2 additions & 2 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def test_nested_exception_group_tracebacks(self):
eg = create_nested_eg()

line0 = create_nested_eg.__code__.co_firstlineno
for (tb, expected) in [
for tb, expected in [
(eg.__traceback__, line0 + 19),
(eg.exceptions[0].__traceback__, line0 + 6),
(eg.exceptions[1].__traceback__, line0 + 14),
Expand All @@ -469,7 +469,7 @@ def test_iteration_full_tracebacks(self):
line0 = create_nested_eg.__code__.co_firstlineno
expected_tbs = [[line0 + 19, line0 + 6, line0 + 4], [line0 + 19, line0 + 14]]

for (i, (_, tbs)) in enumerate(leaf_generator(eg)):
for i, (_, tbs) in enumerate(leaf_generator(eg)):
self.assertSequenceEqual([tb.tb_lineno for tb in tbs], expected_tbs[i])


Expand Down

0 comments on commit 5fbf14a

Please sign in to comment.