[gobject-introspection] giscanner: remove unneeded encode('utf-8').decode('utf-8') roundtrip



commit bb482abafe4bc6d88cbbc4abc36967a3012e9f50
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Thu Apr 25 00:22:59 2013 +0200

    giscanner: remove unneeded encode('utf-8').decode('utf-8') roundtrip
    
    line is a unicode() instance, xml.sax.saxutils.escape() does
    nothing more than call a couple of replace() methods on said
    unicode() instance so it makes little sense to encode line
    into a str() and decode the escaped result back into a unicode().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699533

 giscanner/xmlwriter.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/xmlwriter.py b/giscanner/xmlwriter.py
index 11f8485..4a1dc9f 100755
--- a/giscanner/xmlwriter.py
+++ b/giscanner/xmlwriter.py
@@ -135,7 +135,7 @@ class XMLWriter(object):
             line = line.decode('utf-8')
         assert isinstance(line, unicode)
         if do_escape:
-            line = escape(line.encode('utf-8')).decode('utf-8')
+            line = escape(line)
         if indent:
             self._data.write('%s%s%s' % (
                     self._indent_char * self._indent,


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