From 0bd0abda661af29750bbd3263ab5f93a24b47511 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 15 Oct 2013 09:46:13 +0200 Subject: Catch exceptions liberally when looking for sources. Fix #279. --- debug_toolbar/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index 2d2ff10..b8bb4a1 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -146,7 +146,7 @@ def getframeinfo(frame, context=1): start = lineno - 1 - context // 2 try: lines, lnum = inspect.findsource(frame) - except (IOError, IndexError): + except Exception: # findsource raises platform-dependant exceptions lines = index = None else: start = max(start, 1) -- cgit v1.2.3