##// END OF EJS Templates
`AssertionError`: `assert _xterm_term_title_saved` in WSL (#14480)...
`AssertionError`: `assert _xterm_term_title_saved` in WSL (#14480) `AssertionError`: `assert _xterm_term_title_saved` In some (unknown) situation, it is possible that the `_xterm_term_title_saved` is unset, but the code would make a call to `_restore_term_title_xterm`, resulting in `AssertionError`. At least on replicatable reproduction is returning from `ipython` to `pudb` via `^D^D` on an empty cell. See more details in https://github.com/ipython/ipython/pull/14480 Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com> <details> <summary><em>was:</em></summary> In some (unknown) situation, it is possible that the `_xterm_term_title_saved` is unset, but the code would make a call to `_restore_term_title_xterm`, resulting in `AssertionError`. As title stacking does not seem to be getting traction (https://github.com/microsoft/terminal/issues/14575), do not set the `xterm` variants of `_set_term_title` / `_restore_term_title`. WSL detection: https://superuser.com/a/1749811/533196 Additionally, almost-`black` the file. </details>

File last commit:

r26419:7663c521
r28838:9b8cd4a3 merge main
Show More
generics.py
29 lines | 706 B | text/x-python | PythonLexer
Brian Granger
Work to address the review comments on Fernando's branch....
r2498 # encoding: utf-8
Brian Granger
Continuing a massive refactor of everything.
r2205 """Generic functions for extending IPython.
"""
vivainio
crlf normalization
r851
Brian Granger
Continuing a massive refactor of everything.
r2205 from IPython.core.error import TryNext
Hugo
Replace simplegeneric.generic with functools.singledispatch
r24687 from functools import singledispatch
Brian Granger
Work to address the review comments on Fernando's branch....
r2498
Hugo
Replace simplegeneric.generic with functools.singledispatch
r24687 @singledispatch
vivainio
crlf normalization
r851 def inspect_object(obj):
Brian Granger
Continuing a massive refactor of everything.
r2205 """Called when you do obj?"""
vivainio
crlf normalization
r851 raise TryNext
vivainio
implement complete_object(obj, prev_completions) generic function to provide custom completers for python object attributes (as opposed to string dispatching)
r908
Brian Granger
Work to address the review comments on Fernando's branch....
r2498
Hugo
Replace simplegeneric.generic with functools.singledispatch
r24687 @singledispatch
vivainio
implement complete_object(obj, prev_completions) generic function to provide custom completers for python object attributes (as opposed to string dispatching)
r908 def complete_object(obj, prev_completions):
Brian Granger
Continuing a massive refactor of everything.
r2205 """Custom completer dispatching for python objects.
Parameters
----------
obj : object
The object to complete.
prev_completions : list
List of attributes discovered so far.
vivainio
implement complete_object(obj, prev_completions) generic function to provide custom completers for python object attributes (as opposed to string dispatching)
r908 This should return the list of attributes in obj. If you only wish to
Bernardo B. Marques
remove all trailling spaces
r4872 add to the attributes already discovered normally, return
vivainio
implement complete_object(obj, prev_completions) generic function to provide custom completers for python object attributes (as opposed to string dispatching)
r908 own_attrs + prev_completions.
"""
raise TryNext