summaryrefslogtreecommitdiff
path: root/wsgitools/scgi/asynchronous.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2011-07-18 15:19:39 +0200
committerHelmut Grohne <helmut@subdivi.de>2011-07-18 15:19:39 +0200
commit1966bf28d296e6b0d4e08c8f140ed12fc2960f60 (patch)
tree898756d5f700fc2427d2d846cc066f7e6e220065 /wsgitools/scgi/asynchronous.py
parent19b6693b552b84f92823a26b85abb765c280aed2 (diff)
downloadwsgitools-1966bf28d296e6b0d4e08c8f140ed12fc2960f60.tar.gz
adapt exc_info handling for python 3
Diffstat (limited to 'wsgitools/scgi/asynchronous.py')
-rw-r--r--wsgitools/scgi/asynchronous.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/wsgitools/scgi/asynchronous.py b/wsgitools/scgi/asynchronous.py
index 82dec02..75f1ff0 100644
--- a/wsgitools/scgi/asynchronous.py
+++ b/wsgitools/scgi/asynchronous.py
@@ -11,6 +11,13 @@ except ImportError:
import StringIO as io
import errno
+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 SCGIConnection(asyncore.dispatcher):
"""SCGI connection class used by L{SCGIServer}."""
# connection states
@@ -143,7 +150,7 @@ class SCGIConnection(asyncore.dispatcher):
if exc_info:
if self.outheaders == True:
try:
- raise exc_info[0], exc_info[1], exc_info[2]
+ raise exc_info_for_raise(exc_info)
finally:
exc_info = None
assert self.outheaders != True # unsent