From 4822308d14e88fbfb6a035aa63c29f1fbc99d6d3 Mon Sep 17 00:00:00 2001 From: alexandrebarbaruiva Date: Tue, 16 Jun 2020 09:59:41 -0300 Subject: [PATCH] Change indentation --- ipdb/__main__.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/ipdb/__main__.py b/ipdb/__main__.py index b764e50..b2558b1 100644 --- a/ipdb/__main__.py +++ b/ipdb/__main__.py @@ -65,17 +65,18 @@ def wrap_sys_excepthook(): def set_trace(frame=None, context=None, cond=True): - if cond: - wrap_sys_excepthook() - if not context: - context = os.environ.get( - "IPDB_CONTEXT_SIZE", get_context_from_config() - ) - if frame is None: - frame = sys._getframe().f_back - p = _init_pdb(context).set_trace(frame) - if p and hasattr(p, 'shell'): - p.shell.restore_sys_module_state() + if not cond: + return + wrap_sys_excepthook() + if not context: + context = os.environ.get( + "IPDB_CONTEXT_SIZE", get_context_from_config() + ) + if frame is None: + frame = sys._getframe().f_back + p = _init_pdb(context).set_trace(frame) + if p and hasattr(p, 'shell'): + p.shell.restore_sys_module_state() def get_context_from_config():