22
33# %% ../nbs/02_shell.ipynb 2
44from __future__ import annotations
5+
56from fastcore .basics import *
67from fastcore .imports import *
78from 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+
915import tokenize
1016from IPython .core .interactiveshell import InteractiveShell
1117from 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
191197def 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
203209def exec_nb (
204210 src :str , # Notebook path to read from
0 commit comments