opental-checkins
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OpenTAL-checkins] opental/pax utils.py


From: Fernando Lalo Martins
Subject: [OpenTAL-checkins] opental/pax utils.py
Date: Thu, 27 Feb 2003 13:37:50 -0500

CVSROOT:        /cvsroot/opental
Module name:    opental
Changes by:     Fernando Lalo Martins <address@hidden>  03/02/27 13:37:50

Modified files:
        pax            : utils.py 

Log message:
        yesterday's optimization broke XML() - rendering sequences wouldn't work

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/pax/utils.py.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: opental/pax/utils.py
diff -u opental/pax/utils.py:1.9 opental/pax/utils.py:1.10
--- opental/pax/utils.py:1.9    Mon Jan 27 02:10:54 2003
+++ opental/pax/utils.py        Thu Feb 27 13:37:50 2003
@@ -17,11 +17,13 @@
     except AttributeError:
         pass
     try:
-        # unicode or ascii string?
-        return unicode(escape(obj))
-    except UnicodeError:
-        # non-ascii string?
-        return escape(unicode(obj, encoding, _replace))
+        # string?
+        obj = escape(obj)
+        try:
+            return unicode(obj, encoding, _replace)
+        except TypeError:
+            # no, unicode
+            return obj
     except AttributeError:
         pass
     try:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]