Skip to content

Commit b8aa91d

Browse files
Fix post mortem debugger for exception when yielding items or in close().
1 parent b5d4a8d commit b8aa91d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

docs/release-notes/version-4.4.20.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,10 @@ Version 4.4.20 of mod_wsgi can be obtained from:
99
For details on the availability of Windows binaries see:
1010

1111
https://github.com/GrahamDumpleton/mod_wsgi/tree/master/win32
12+
13+
Bugs Fixed
14+
----------
15+
16+
1. Post mortem debugger would fail if the exception was raised during
17+
yielding of items from a WSGI application, or inside of any ``close()``
18+
callable of an iterator returned from the WSGI application.

src/server/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,15 +1117,15 @@ def __iter__(self):
11171117
for item in self.generator:
11181118
yield item
11191119
except Exception:
1120-
self.debug_exception()
1120+
self.run_post_mortem()
11211121
raise
11221122

11231123
def close(self):
11241124
try:
11251125
if hasattr(self.generator, 'close'):
11261126
return self.generator.close()
11271127
except Exception:
1128-
self.debug_exception()
1128+
self.run_post_mortem()
11291129
raise
11301130

11311131
class RequestRecorder(object):

0 commit comments

Comments
 (0)