Skip to content
Prev Previous commit
Next Next commit
fix smelly symbol and whitespace
  • Loading branch information
iritkatriel committed May 11, 2021
commit 9ffd6e5e3abde571ca06e5913c306c8224814031
10 changes: 5 additions & 5 deletions Lib/test/test_exception_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def test_basics_ExceptionGroup_fields(self):
# check msg
self.assertEqual(eg.message, 'simple EG')
self.assertEqual(eg.args[0], 'simple EG')

# check cause and context
self.assertIsInstance(eg.exceptions[0], ValueError)
self.assertIsInstance(eg.exceptions[0].__cause__, MemoryError)
Expand Down Expand Up @@ -380,7 +380,7 @@ def check(exc, expected):
check(eg.exceptions[0], ['nested_group'])
check(eg.exceptions[1], ['nested_group', 'raiseVE'])
check(eg.exceptions[0].exceptions[0], ['nested_group', 'raiseTE'])

def test_iteration_full_tracebacks(self):
eg = self.eg
# check that iteration over leaves
Expand Down Expand Up @@ -471,7 +471,7 @@ def level1(i):
except Exception as e:
excs.append(e)
raise ExceptionGroup('msg1', excs)

def level2(i):
excs = []
for f, arg in [(level1, i), (level1, i+1), (raiseVE, i+2)]:
Expand Down Expand Up @@ -513,7 +513,7 @@ def level3(i):
],
ValueError(7)]

typeErrors_template = [[[TypeError(int)], [TypeError(int)]]]
typeErrors_template = [[[TypeError(int)], [TypeError(int)]]]

self.assertMatchesTemplate(eg, ExceptionGroup, eg_template)

Expand Down Expand Up @@ -568,7 +568,7 @@ def exc(ex):
self.assertIsNone(match)
self.assertMatchesTemplate(
rest, BaseExceptionGroup, [ValueError(1), KeyboardInterrupt(2)])

# Match Everything
match, rest = self._split_exception_group(beg, (ValueError, KeyboardInterrupt))
self.assertMatchesTemplate(
Expand Down
3 changes: 2 additions & 1 deletion Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,8 @@ ComplexExtendsException(PyExc_BaseException, BaseExceptionGroup,
/*
* ExceptionGroup extends BaseExceptionGroup, Exception
*/
PyObject* create_exception_group_class() {
static PyObject*
create_exception_group_class() {
PyObject *bases = PyTuple_Pack(
2, PyExc_BaseExceptionGroup, PyExc_Exception);
if (bases == NULL) {
Expand Down