Skip to content

Commit 4d78e3c

Browse files
authored
Merge pull request #2 from davidbrochart/zombieProcFix
Zombie proc fix
2 parents f502655 + 0367a7d commit 4d78e3c

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

nbclient/exceptions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ class CellExecutionError(CellControlSignal):
4949
failures gracefully.
5050
"""
5151

52-
def __init__(self, traceback):
52+
def __init__(self, traceback, ename, evalue):
5353
super(CellExecutionError, self).__init__(traceback)
5454
self.traceback = traceback
55+
self.ename = ename
56+
self.evalue = evalue
5557

5658
def __str__(self):
5759
s = self.__unicode__()
@@ -74,7 +76,9 @@ def from_cell_and_msg(cls, cell, msg):
7476
traceback=tb,
7577
ename=msg.get('ename', '<Error>'),
7678
evalue=msg.get('evalue', ''),
77-
)
79+
),
80+
ename=msg.get('ename', '<Error>'),
81+
evalue=msg.get('evalue', '')
7882
)
7983

8084

nbclient/tests/test_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -505,12 +505,13 @@ def test_kernel_death(self):
505505
output_nb = executor.execute()
506506
km = executor.start_kernel_manager()
507507

508-
with patch.object(km, "is_alive") as alive_mock:
509-
alive_mock.return_value = False
510-
# Will be a RuntimeError or subclass DeadKernelError depending
511-
# on if jupyter_client or nbconvert catches the dead client first
512-
with pytest.raises(RuntimeError):
513-
input_nb, output_nb = executor.execute()
508+
async def is_alive():
509+
return False
510+
km.is_alive = is_alive
511+
# Will be a RuntimeError or subclass DeadKernelError depending
512+
# on if jupyter_client or nbconvert catches the dead client first
513+
with pytest.raises(RuntimeError):
514+
input_nb, output_nb = executor.execute()
514515

515516
def test_allow_errors(self):
516517
"""

0 commit comments

Comments
 (0)