Commit 5f19c23a authored by Fabien Amarger's avatar Fabien Amarger
Browse files

fix: [cwetype] Use new key param for the sorted function

To do so we use the functools "cmp_to_key" to convert from the
old cmp to the new key param type.

--HG--
branch : 3.26
parent a3d682abd5c3
......@@ -142,8 +142,7 @@ class SchemaViewer(object):
first = True
rel_defs = sorted(eschema.relation_definitions(),
cmp=(lambda x, y: cmp((x[0].type, x[0].cardinality),
(y[0].type, y[0].cardinality))))
key=lambda el: el[0].type)
for rschema, targetschemas, role in rel_defs:
if rschema.type in skiptypes:
continue
......
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