fw at alioth.debian.org
2008-Dec-01 19:05 UTC
[Secure-testing-commits] r10566 - lib/python
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)