Commit e443a708 authored by Chris McDonough's avatar Chris McDonough

Check for both stringtype and unicodetype to prevent future problems.

parent 6cc79af9
...@@ -45,8 +45,8 @@ import DebugLogger ...@@ -45,8 +45,8 @@ import DebugLogger
from cStringIO import StringIO from cStringIO import StringIO
from tempfile import TemporaryFile from tempfile import TemporaryFile
import socket, string, os, sys, time import socket, string, os, sys, time
from types import StringType
import thread import thread
from types import StringTypes
tz_for_log = compute_timezone_for_log() tz_for_log = compute_timezone_for_log()
...@@ -558,7 +558,7 @@ class FCGIChannel(asynchat.async_chat): ...@@ -558,7 +558,7 @@ class FCGIChannel(asynchat.async_chat):
self.closed=1 self.closed=1
while self.producer_fifo: while self.producer_fifo:
p=self.producer_fifo.first() p=self.producer_fifo.first()
if p is not None and type(p) != StringType: if p is not None and not isinstance(p, StringTypes):
p.more() # free up resources held by producer p.more() # free up resources held by producer
self.producer_fifo.pop() self.producer_fifo.pop()
asyncore.dispatcher.close(self) asyncore.dispatcher.close(self)
......
...@@ -35,10 +35,10 @@ import sys ...@@ -35,10 +35,10 @@ import sys
import re import re
import os import os
import posixpath import posixpath
import types
import thread import thread
import time import time
import socket import socket
from types import StringTypes
from cStringIO import StringIO from cStringIO import StringIO
from PubCore import handle from PubCore import handle
...@@ -338,7 +338,7 @@ class zhttp_channel(http_channel): ...@@ -338,7 +338,7 @@ class zhttp_channel(http_channel):
self.current_request=None self.current_request=None
while self.producer_fifo: while self.producer_fifo:
p=self.producer_fifo.first() p=self.producer_fifo.first()
if p is not None and type(p) != types.StringType: if p is not None and not isinstance(p, StringTypes):
p.more() # free up resources held by producer p.more() # free up resources held by producer
self.producer_fifo.pop() self.producer_fifo.pop()
dispatcher.close(self) dispatcher.close(self)
......
...@@ -47,7 +47,7 @@ import DebugLogger ...@@ -47,7 +47,7 @@ import DebugLogger
from cStringIO import StringIO from cStringIO import StringIO
from tempfile import TemporaryFile from tempfile import TemporaryFile
import socket, string, os, sys, time import socket, string, os, sys, time
from types import StringType, TupleType from types import TupleType, StringTypes
tz_for_log=compute_timezone_for_log() tz_for_log=compute_timezone_for_log()
...@@ -203,7 +203,7 @@ class PCGIChannel(asynchat.async_chat): ...@@ -203,7 +203,7 @@ class PCGIChannel(asynchat.async_chat):
self.closed=1 self.closed=1
while self.producer_fifo: while self.producer_fifo:
p=self.producer_fifo.first() p=self.producer_fifo.first()
if p is not None and type(p) != StringType: if p is not None and not isinstance(p, StringTypes):
p.more() # free up resources held by producer p.more() # free up resources held by producer
self.producer_fifo.pop() self.producer_fifo.pop()
asyncore.dispatcher.close(self) asyncore.dispatcher.close(self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment