File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ def _user_ns_changed(self, change):
67
67
_sys_raw_input = Any ()
68
68
_sys_eval_input = Any ()
69
69
70
+ comm_msg_types = [ 'comm_open' , 'comm_msg' , 'comm_close' ]
71
+
70
72
def __init__ (self , ** kwargs ):
71
73
super (IPythonKernel , self ).__init__ (** kwargs )
72
74
@@ -94,8 +96,7 @@ def __init__(self, **kwargs):
94
96
self .comm_manager = CommManager (parent = self , kernel = self )
95
97
96
98
self .shell .configurables .append (self .comm_manager )
97
- comm_msg_types = [ 'comm_open' , 'comm_msg' , 'comm_close' ]
98
- for msg_type in comm_msg_types :
99
+ for msg_type in self .comm_msg_types :
99
100
self .shell_handlers [msg_type ] = getattr (self .comm_manager , msg_type )
100
101
101
102
if _use_appnope () and self ._darwin_app_nap :
@@ -555,6 +556,16 @@ def do_clear(self):
555
556
self .shell .reset (False )
556
557
return dict (status = 'ok' )
557
558
559
+ def should_dispatch_immediately (self , msg , * args ):
560
+ try :
561
+ msg_type = msg ['header' ]['msg_type' ]
562
+ if msg_type in self .comm_msg_types :
563
+ return True
564
+ except ValueError :
565
+ pass
566
+
567
+ return False
568
+
558
569
559
570
# This exists only for backwards compatibility - use IPythonKernel instead
560
571
You can’t perform that action at this time.
0 commit comments