summaryrefslogtreecommitdiff
path: root/wsgitools/scgi/forkpool.py
diff options
context:
space:
mode:
Diffstat (limited to 'wsgitools/scgi/forkpool.py')
-rw-r--r--wsgitools/scgi/forkpool.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/wsgitools/scgi/forkpool.py b/wsgitools/scgi/forkpool.py
index 252c455..b090a54 100644
--- a/wsgitools/scgi/forkpool.py
+++ b/wsgitools/scgi/forkpool.py
@@ -12,6 +12,13 @@ import sys
import errno
import signal
+if sys.version_info[0] >= 3:
+ def exc_info_for_raise(exc_info):
+ return exc_info[0](exc_info[1]).with_traceback(exc_info[2])
+else:
+ def exc_info_for_raise(exc_info):
+ return exc_info[0], exc_info[1], exc_info[2]
+
class SocketFileWrapper:
"""Wraps a socket to a wsgi-compliant file-like object."""
def __init__(self, sock, toread):
@@ -396,7 +403,7 @@ class SCGIServer:
def start_response(status, headers, exc_info=None):
if exc_info and response_head[0]:
try:
- raise exc_info[0], exc_info[1], exc_info[2]
+ raise exc_info_for_raise(exc_info)
finally:
exc_info = None
assert not response_head[0] # unset or not sent