Code

Ticket #10758: patch.diff

File patch.diff, 1.1 KB (added by kevinh, 4 years ago)

fixes both issues.

Line 
1Index: django/core/handlers/base.py
2===================================================================
3--- django/core/handlers/base.py        (revision 13316)
4+++ django/core/handlers/base.py        (working copy)
5@@ -135,11 +135,10 @@
6             except SystemExit:
7                 # Allow sys.exit() to actually exit. See tickets #1023 and #4701
8                 raise
9-            except: # Handle everything else, including SuspiciousOperation, etc.
10+            except Exception: # Handle everything else, including SuspiciousOperation, etc.
11                 # Get the exception info now, in case another exception is thrown later.
12-                exc_info = sys.exc_info()
13                 receivers = signals.got_request_exception.send(sender=self.__class__, request=request)
14-                return self.handle_uncaught_exception(request, resolver, exc_info)
15+                return self.handle_uncaught_exception(request, resolver, sys.exc_info())
16         finally:
17             # Reset URLconf for this thread on the way out for complete
18             # isolation of request.urlconf