diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-09-30 10:27:28 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-09-30 10:47:10 +0300 |
commit | 5a6373c9d09bbfb7094f9992a4531477bb97829e (patch) | |
tree | ebea8fd55fee858876743312cdf789a1f01487b5 /contrib/python/ipython/py3/IPython/core/ultratb.py | |
parent | 15f3c7493474de25a6b23296878bb8f49470d2e6 (diff) | |
download | ydb-5a6373c9d09bbfb7094f9992a4531477bb97829e.tar.gz |
Update contrib/python/ipython/py3 to 8.15.0
Diffstat (limited to 'contrib/python/ipython/py3/IPython/core/ultratb.py')
-rw-r--r-- | contrib/python/ipython/py3/IPython/core/ultratb.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/python/ipython/py3/IPython/core/ultratb.py b/contrib/python/ipython/py3/IPython/core/ultratb.py index 61b5939398..cb0d8f951f 100644 --- a/contrib/python/ipython/py3/IPython/core/ultratb.py +++ b/contrib/python/ipython/py3/IPython/core/ultratb.py @@ -809,6 +809,7 @@ class VerboseTB(TBTools): would appear in the traceback).""" _tb_highlight = "" + _tb_highlight_style = "default" def __init__( self, @@ -1110,7 +1111,7 @@ class VerboseTB(TBTools): after = context // 2 before = context - after if self.has_colors: - style = get_style_by_name("default") + style = get_style_by_name(self._tb_highlight_style) style = stack_data.style_with_executing_node(style, self._tb_highlight) formatter = Terminal256Formatter(style=style) else: @@ -1245,7 +1246,13 @@ class VerboseTB(TBTools): if etb and etb.tb_next: etb = etb.tb_next self.pdb.botframe = etb.tb_frame - self.pdb.interaction(None, etb) + # last_value should be deprecated, but last-exc sometimme not set + # please check why later and remove the getattr. + exc = sys.last_value if sys.version_info < (3, 12) else getattr(sys, "last_exc", sys.last_value) # type: ignore[attr-defined] + if exc: + self.pdb.interaction(None, exc) + else: + self.pdb.interaction(None, etb) if hasattr(self, 'tb'): del self.tb |