Skip to content
This repository was archived by the owner on Nov 2, 2022. It is now read-only.

Commit eb9e920

Browse files
committed
update exceptiongroup arguments.
1 parent 3756f42 commit eb9e920

2 files changed

Lines changed: 2 additions & 15 deletions

File tree

exceptiongroup/__init__.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,8 @@ class ExceptionGroup(BaseException):
2525
2626
"""
2727

28-
def __init__(self, *args):
29-
EXPECT_ARG_LENGTH = 3
30-
if len(args) < EXPECT_ARG_LENGTH:
31-
raise ValueError(
32-
"The length of args should be equal to {}".format(
33-
EXPECT_ARG_LENGTH
34-
)
35-
)
36-
message, exceptions, sources = args[0], args[1], args[2]
37-
super().__init__(message)
28+
def __init__(self, message, exceptions, sources):
29+
super().__init__(message, exceptions, sources)
3830
self.exceptions = list(exceptions)
3931
for exc in self.exceptions:
4032
if not isinstance(exc, BaseException):

exceptiongroup/_tests/test_exceptiongroup.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ def test_exception_group_when_members_are_not_exceptions():
2323
)
2424

2525

26-
def test_exception_group_init_when_length_of_args_is_less_than_3():
27-
with pytest.raises(ValueError):
28-
ExceptionGroup("error")
29-
30-
3126
def test_exception_group_init_when_exceptions_messages_not_equal():
3227
with pytest.raises(ValueError):
3328
ExceptionGroup(

0 commit comments

Comments
 (0)