[Secure-testing-commits] r10566 - lib/python
fw at alioth.debian.org
fw at alioth.debian.org
Mon Dec 1 19:05:23 UTC 2008
Author: fw
Date: 2008-12-01 19:05:22 +0000 (Mon, 01 Dec 2008)
New Revision: 10566
Modified:
lib/python/web_support.py
Log:
lib/python/web_support.py: one more typing fix for Python 2.5
We suddenly have to deal with additional Unicode strings.
Modified: lib/python/web_support.py
===================================================================
--- lib/python/web_support.py 2008-12-01 19:05:20 UTC (rev 10565)
+++ lib/python/web_support.py 2008-12-01 19:05:22 UTC (rev 10566)
@@ -254,6 +254,8 @@
def flatten(self, write):
write(self.__contents)
+_string_types = (types.StringType, types.UnicodeType)
+
class Compose(HTMLBase):
"""Glues a sequence of HTML snippets together, without enclosing it in
a tag."""
@@ -262,7 +264,7 @@
def flatten(self, write):
for x in self.__contents:
- if type(x) == types.StringType:
+ if type(x) in _string_types:
write(escapeHTML(x))
else:
x.flatten(write)
@@ -310,7 +312,7 @@
closing = "</%s>" % self.__name
try:
for x in self.contents:
- if type(x) == types.StringType:
+ if type(x) in _string_types:
write(escapeHTML(x))
else:
x.flatten(write)
More information about the Secure-testing-commits
mailing list