File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -366,10 +366,10 @@ def process_event(self, e):
366366 self .request_paint_to_clear_screen = True
367367 elif e in key_dispatch [self .config .last_output_key ]: #TODO Not Implemented
368368 pass
369- elif e in ('\x1f ' ,) + key_dispatch [self .config .show_source_key ]: #TODO Not Implemented
369+ elif e in ('\x1f ' ,) + key_dispatch [self .config .show_source_key ]:
370370 source = self .get_source_of_current_name ()
371371 if source is None :
372- self .status_bar .message ('whoops!' )
372+ self .status_bar .message (_ ( 'Cannot show source.' ) )
373373 else :
374374 if self .config .highlight_show_source :
375375 source = format (PythonLexer ().get_tokens (source ), TerminalFormatter ())
Original file line number Diff line number Diff line change @@ -577,10 +577,13 @@ def get_source_of_current_name(self):
577577 source cannot be found."""
578578 try :
579579 obj = self .current_func
580+ logging .debug ('current func is %r' , obj )
580581 if obj is None :
581582 line = self .current_line
582583 if inspection .is_eval_safe_name (line ):
583584 obj = self .get_object (line )
585+ if obj is None :
586+ return None
584587 source = inspect .getsource (obj )
585588 except (AttributeError , IOError , NameError , TypeError ):
586589 return None
You can’t perform that action at this time.
0 commit comments