Skip to content

Commit b90ff35

Browse files
authored
Merge pull request #39 from seeM/fix-nbdev-add-links
`CaptureShell.shell` sets `cell.outputs` to ordinary dicts instead of `AttrDict`s
2 parents 0e4c476 + f7148b4 commit b90ff35

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

execnb/shell.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
from .fastshell import FastInteractiveShell
2626
from .nbio import *
27+
from .nbio import _dict2obj
2728

2829
from collections.abc import Callable
2930

@@ -150,7 +151,7 @@ def cell(self:CaptureShell, cell, stdout=True, stderr=True):
150151
self._cell_idx = cell.idx_ + 1
151152
outs = self.run(cell.source)
152153
if outs:
153-
cell.outputs = outs
154+
cell.outputs = _dict2obj(outs)
154155
for o in outs:
155156
if 'execution_count' in o: cell['execution_count'] = o['execution_count']
156157

nbs/02_shell.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"\n",
5050
"from execnb.fastshell import FastInteractiveShell\n",
5151
"from execnb.nbio import *\n",
52+
"from execnb.nbio import _dict2obj\n",
5253
"\n",
5354
"from collections.abc import Callable"
5455
]
@@ -441,7 +442,7 @@
441442
" self._cell_idx = cell.idx_ + 1\n",
442443
" outs = self.run(cell.source)\n",
443444
" if outs:\n",
444-
" cell.outputs = outs\n",
445+
" cell.outputs = _dict2obj(outs)\n",
445446
" for o in outs:\n",
446447
" if 'execution_count' in o: cell['execution_count'] = o['execution_count']"
447448
]

0 commit comments

Comments
 (0)