From 77e6bd2c5c81f76f07d5907d75c4dc7b344b8285 2012-12-17 18:19:38 From: tcmulcahy Date: 2012-12-17 18:19:38 Subject: [PATCH] Update IPython/core/debugger.py Correctly print stack traces when context is larger than lines of source. --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index b173a5a..83e9a32 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -352,8 +352,8 @@ class Pdb(OldPdb): start = lineno - 1 - context//2 lines = ulinecache.getlines(filename) - start = max(start, 0) start = min(start, len(lines) - context) + start = max(start, 0) lines = lines[start : start + context] for i,line in enumerate(lines):