summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFlorian Weimer <fw@deneb.enyo.de>2008-12-01 19:05:22 +0000
committerFlorian Weimer <fw@deneb.enyo.de>2008-12-01 19:05:22 +0000
commit4c6f0eb180525b8213aa5c905be9047db3ab60e0 (patch)
treeb565abb1aa96ee7dbd799faf96afd940e6e9e2f8 /lib
parent49069e4b071717541502bc8e0cc206fa7724c373 (diff)
lib/python/web_support.py: one more typing fix for Python 2.5
We suddenly have to deal with additional Unicode strings. git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@10566 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib')
-rw-r--r--lib/python/web_support.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py
index e4746e7fe1..f4bd853f00 100644
--- a/lib/python/web_support.py
+++ b/lib/python/web_support.py
@@ -254,6 +254,8 @@ class VerbatimHTML(HTMLBase):
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 @@ class Compose(HTMLBase):
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 @@ class Tag(HTMLBase):
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)

© 2014-2024 Faster IT GmbH | imprint | privacy policy