File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717from collections import defaultdict
1818from threading import Thread
1919from inspect import isclass
20- from pygments import Token
20+ from pygments import token
2121
2222from IPython .utils import PyColorize
2323from IPython import get_ipython
@@ -203,6 +203,11 @@ def findsymbol(arg):
203203 def suggestion (arg ):
204204 global _symbols_last
205205 args = parse_argstring (suggestion , arg )
206+
207+ if not _symbols_last :
208+ print ("No suggestions available." )
209+ return
210+
206211 if - len (_symbols_last ) < args .suggestion_index < len (_symbols_last ):
207212 method , line = _symbols_last [args .suggestion_index ]
208213 if method == "exec" :
@@ -214,7 +219,7 @@ def suggestion(arg):
214219 pass
215220 print (
216221 PyColorize .theme_table [shell .colors ].format (
217- [Token .Number , f"Suggestions: { line } " ]
222+ [( token .Number , f"Suggestions: { line } " ) ]
218223 )
219224 )
220225 # print(
You can’t perform that action at this time.
0 commit comments