Commit 3d98fcdb authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Use print function in xsd2yams

This makes the module syntactically valid with Python 3. Flake8 does not
complain accordingly.
parent 2aabb43e5c04
......@@ -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 @@ class XSYMapping(object):
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 @@ def _merge_mapping(ref_mapping, subjtype, rtype, objtype, composite, card=None):
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment