From 73e958a9b2ca244a6e7ec4e85ef91327425d8aba Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Tue, 31 Aug 2010 12:31:51 +0200 Subject: bugfix: io module from py2.6 provides incompatible StringIO --- wsgitools/scgi/asynchronous.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'wsgitools/scgi/asynchronous.py') diff --git a/wsgitools/scgi/asynchronous.py b/wsgitools/scgi/asynchronous.py index b51e7ca..ecc27fb 100644 --- a/wsgitools/scgi/asynchronous.py +++ b/wsgitools/scgi/asynchronous.py @@ -3,13 +3,12 @@ __all__ = [] import asyncore import socket import sys +# Cannot use io module as it is broken in 2.6. +# Writing a str to a io.StringIO results in an exception. try: - import io + import cStringIO as io except ImportError: - try: - import cStringIO as io - except ImportError: - import StringIO as io + import StringIO as io class SCGIConnection(asyncore.dispatcher): """SCGI connection class used by L{SCGIServer}.""" -- cgit v1.2.3