From ed51c888895583a856f40ce951c0c131a26f9ca3 Mon Sep 17 00:00:00 2001 From: ianb Date: Tue, 17 May 2005 03:06:22 +0000 Subject: A bunch of pylint-inspired changes; all minor code cleanup --- paste/cgitb_catcher.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'paste/cgitb_catcher.py') diff --git a/paste/cgitb_catcher.py b/paste/cgitb_catcher.py index 732f7e1..b417583 100644 --- a/paste/cgitb_catcher.py +++ b/paste/cgitb_catcher.py @@ -9,7 +9,6 @@ documentation for more: import cgitb from cStringIO import StringIO import sys -import traceback class DummyFile(object): pass @@ -24,7 +23,7 @@ def middleware(application, **kw): return started[0] try: - app_iter = application(environ, start_response) + app_iter = application(environ, detect_start_response) return catching_iter(app_iter) except: if not started: @@ -40,12 +39,12 @@ def middleware(application, **kw): hook(*sys.exc_info()) return [dummy_file.getvalue()] - def catching_iter(iter): - if not iter: + def catching_iter(app_iter): + if not app_iter: raise StopIteration try: - for v in iter: - yield iter + for v in app_iter: + yield v except: exc = sys.exc_info() dummy_file = StringIO() -- cgit v1.2.1