@@ -140,35 +140,35 @@ def tmp(*parts):
140140
141141 started = Event ()
142142 def start_thread ():
143- app = cls .notebook = NotebookApp (
144- port = cls .port ,
145- port_retries = 0 ,
146- open_browser = False ,
147- config_dir = cls .config_dir ,
148- data_dir = cls .data_dir ,
149- runtime_dir = cls .runtime_dir ,
150- notebook_dir = cls .notebook_dir ,
151- base_url = cls .url_prefix ,
152- config = config ,
153- allow_root = True ,
154- token = cls .token ,
155- )
156- if 'asyncio' in sys .modules :
157- app ._init_asyncio_patch ()
158- import asyncio
159- asyncio .set_event_loop (asyncio .new_event_loop ())
160- # don't register signal handler during tests
161- app .init_signal = lambda : None
162- # clear log handlers and propagate to root for nose to capture it
163- # needs to be redone after initialize, which reconfigures logging
164- app .log .propagate = True
165- app .log .handlers = []
166- app .initialize (argv = cls .get_argv ())
167- app .log .propagate = True
168- app .log .handlers = []
169- loop = IOLoop .current ()
170- loop .add_callback (started .set )
171143 try :
144+ app = cls .notebook = NotebookApp (
145+ port = cls .port ,
146+ port_retries = 0 ,
147+ open_browser = False ,
148+ config_dir = cls .config_dir ,
149+ data_dir = cls .data_dir ,
150+ runtime_dir = cls .runtime_dir ,
151+ notebook_dir = cls .notebook_dir ,
152+ base_url = cls .url_prefix ,
153+ config = config ,
154+ allow_root = True ,
155+ token = cls .token ,
156+ )
157+ if 'asyncio' in sys .modules :
158+ app ._init_asyncio_patch ()
159+ import asyncio
160+ asyncio .set_event_loop (asyncio .new_event_loop ())
161+ # don't register signal handler during tests
162+ app .init_signal = lambda : None
163+ # clear log handlers and propagate to root for nose to capture it
164+ # needs to be redone after initialize, which reconfigures logging
165+ app .log .propagate = True
166+ app .log .handlers = []
167+ app .initialize (argv = cls .get_argv ())
168+ app .log .propagate = True
169+ app .log .handlers = []
170+ loop = IOLoop .current ()
171+ loop .add_callback (started .set )
172172 app .start ()
173173 finally :
174174 # set the event, so failure to start doesn't cause a hang
0 commit comments