From 21ac5592cd975885a655a3491505cfc82fa848bf 2020-07-16 18:16:33 From: Matthias Bussonnier Date: 2020-07-16 18:16:33 Subject: [PATCH] Merge branch 'master' into fix-rm-harcoded-colors --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index c122441..e3834fc 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -294,7 +294,14 @@ class Pdb(OldPdb): This is used in up/down and where to skip frames. """ - ip_hide = [s[0].f_locals.get("__tracebackhide__", False) for s in stack] + # The f_locals dictionary is updated from the actual frame + # locals whenever the .f_locals accessor is called, so we + # avoid calling it here to preserve self.curframe_locals. + # Futhermore, there is no good reason to hide the current frame. + ip_hide = [ + False if s[0] is self.curframe else s[0].f_locals.get( + "__tracebackhide__", False) + for s in stack] ip_start = [i for i, s in enumerate(ip_hide) if s == "__ipython_bottom__"] if ip_start: ip_hide = [h if i > ip_start[0] else True for (i, h) in enumerate(ip_hide)] diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index 360d885..ed34228 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -356,6 +356,7 @@ class TerminalInteractiveShell(InteractiveShell): Token.Name.Function: '#ansiblue', Token.Name.Class: 'bold #ansiblue', Token.Name.Namespace: 'bold #ansiblue', + Token.Name.Variable.Magic: '#ansiblue', Token.Prompt: '#ansigreen', Token.PromptNum: '#ansibrightgreen bold', Token.OutPrompt: '#ansired',