[caribou] Fix errors when building with python 3



commit c19a148913b51981cef3229601eb95178569678b
Author: Daiki Ueno <ueno unixuser org>
Date:   Thu Feb 28 19:16:24 2013 +0900

    Fix errors when building with python 3
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694480

 tools/fix_gir.py     |    4 ++--
 tools/make_schema.py |    8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/tools/fix_gir.py b/tools/fix_gir.py
index 30bd878..182d108 100755
--- a/tools/fix_gir.py
+++ b/tools/fix_gir.py
@@ -42,7 +42,7 @@ if __name__ == "__main__":
     import sys
 
     if len(sys.argv) != 2:
-        print "supply a gir file"
+        print("supply a gir file")
         sys.exit(1)
 
     dom = minidom.parse(sys.argv[-1])
@@ -50,4 +50,4 @@ if __name__ == "__main__":
     purge_white_space_and_fix_namespace(dom)
     fix_vfuncs(dom)
 
-    print dom.toprettyxml(indent=" ", newl="\n")
+    print(dom.toprettyxml(indent=" ", newl="\n"))
diff --git a/tools/make_schema.py b/tools/make_schema.py
index f8386dc..5633594 100755
--- a/tools/make_schema.py
+++ b/tools/make_schema.py
@@ -3,7 +3,7 @@
 from gi.repository import GLib
 import xml.dom.minidom
 
-import os,sys
+import os, sys
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from caribou.settings import caribou_settings
@@ -27,10 +27,10 @@ class SchemasMaker:
         fp.close()
 
     def _attribs(self, e):
-        if not e.attributes.items():
+        if not list(e.attributes.items()):
             return ""
-        return ' ' + ' '.join(['%s="%s"' % (k,v) \
-                                   for k,v in e.attributes.items()])
+        return ' ' + ' '.join(['%s="%s"' % (k, v) \
+                                   for k, v in list(e.attributes.items())])
 
     def _pretty_xml(self, fp, e, indent=0):
         if not e.childNodes or \


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