Skip to content

Commit 8d28d0f

Browse files
committed
fixes #22
1 parent 50d8c2b commit 8d28d0f

File tree

5 files changed

+143
-76
lines changed

5 files changed

+143
-76
lines changed

execnb/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.8"
1+
__version__ = "0.0.9"

execnb/_modidx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
'title': 'execnb',
2828
'tst_flags': 'notest',
2929
'user': 'fastai',
30-
'version': '0.0.8'},
30+
'version': '0.0.9'},
3131
'syms': { 'execnb.fastshell': { 'execnb.fastshell.FastInteractiveShell': 'https://fastai.github.io/execnb/fastshell#FastInteractiveShell',
3232
'execnb.fastshell.FastInteractiveShell.ask_exit': 'https://fastai.github.io/execnb/fastshell#FastInteractiveShell.ask_exit',
3333
'execnb.fastshell.FastInteractiveShell.data_pub': 'https://fastai.github.io/execnb/fastshell#FastInteractiveShell.data_pub',

execnb/shell.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
# %% ../nbs/02_shell.ipynb 2
44
from __future__ import annotations
5+
56
from fastcore.basics import *
67
from fastcore.imports import *
78
from fastcore.script import call_parse
89

10+
import multiprocessing
11+
try:
12+
if sys.platform == 'darwin': multiprocessing.set_start_method("fork")
13+
except RuntimeError: pass # if re-running cell
14+
915
import tokenize
1016
from IPython.core.interactiveshell import InteractiveShell
1117
from IPython.core.displayhook import DisplayHook
@@ -186,7 +192,7 @@ def execute(self:CaptureShell,
186192
inject_code=inject_code, inject_idx=inject_idx)
187193
if dest: write_nb(nb, dest)
188194

189-
# %% ../nbs/02_shell.ipynb 44
195+
# %% ../nbs/02_shell.ipynb 45
190196
@patch
191197
def prettytb(self:CaptureShell,
192198
fname:str|Path=None): # filename to print alongside the traceback
@@ -198,7 +204,7 @@ def prettytb(self:CaptureShell,
198204
fname_str = f' in {fname}' if fname else ''
199205
return f"{type(self.exc[1]).__name__}{fname_str}:\n{_fence}\n{cell_str}\n"
200206

201-
# %% ../nbs/02_shell.ipynb 64
207+
# %% ../nbs/02_shell.ipynb 65
202208
@call_parse
203209
def exec_nb(
204210
src:str, # Notebook path to read from

0 commit comments

Comments
 (0)