Use print function in xsd2yams
authorDenis Laxalde <denis.laxalde@logilab.fr>
Tue, 20 Feb 2018 08:28:39 +0100
changeset 2941 241e87a8ba9e
parent 2938 2aabb43e5c04
child 2942 c952e0143549
Use print function in xsd2yams This makes the module syntactically valid with Python 3. Flake8 does not complain accordingly.
cubicweb_seda/xsd2yams.py
--- a/cubicweb_seda/xsd2yams.py	Tue Feb 13 15:54:28 2018 +0100
+++ b/cubicweb_seda/xsd2yams.py	Tue Feb 20 08:28:39 2018 +0100
@@ -15,6 +15,7 @@
 # with this program. If not, see <http://www.gnu.org/licenses/>.
 """Generate Yams schema from XSD file. XSD parsing is done using pyxst.
 """
+from __future__ import print_function
 
 try:
     from yams import BASE_TYPES
@@ -454,7 +455,7 @@
                     cards = set(cards)
                     emapping_cards = set(emapping.cards)
                     if cards - emapping_cards:
-                        print "# XXX extending cards for", emapping, cards - emapping_cards
+                        print("# XXX extending cards for", emapping, cards - emapping_cards)
                         emapping.cards = sorted(emapping_cards | cards)
         else:
             self.etypes[emapping.etype] = emapping
@@ -487,8 +488,8 @@
     assert composite == ref_mapping.composite, (ref_mapping, composite)
     if card is not None:
         if not card == ref_mapping.card[1]:
-            print '# XXX unsupported merge because of incompatible cardinality', subjtype, rtype, \
-                objtype, card, ref_mapping, ref_mapping.card
+            print('# XXX unsupported merge because of incompatible cardinality', subjtype, rtype,
+                  objtype, card, ref_mapping, ref_mapping.card)
         ref_mapping.objtypes.update(_ensure_set(objtype))
     else:
         assert ref_mapping.objtypes == _ensure_set(objtype)