From 6825835bb6e28a0f7c1c6ca5229104e173d91c80 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Sep 2018 10:42:46 +0200 Subject: Fix building documentation with Python 3.7 --- lv2specgen/lv2specgen.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 004e5bd..ff07128 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -1262,8 +1262,7 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, root spec_ns = rdflib.Namespace(spec_ns_str) namespaces = getNamespaces(m) - keys = namespaces.keys() - keys.sort() + keys = sorted(namespaces.keys()) prefixes_html = "" for i in keys: uri = namespaces[i] @@ -1289,8 +1288,8 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, root instalist = None if instances: - instalist = getInstances(m, classlist, proplist) - instalist.sort(lambda x, y: cmp(getShortName(x).lower(), getShortName(y).lower())) + instalist = sorted(getInstances(m, classlist, proplist), + key=lambda x: getShortName(x).lower()) filelist = [] see_also_files = specProperties(m, spec, rdfs.seeAlso) @@ -1393,7 +1392,7 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, root def save(path, text): try: f = open(path, "w") - f.write(text.encode("utf-8")) + f.write(text) f.flush() f.close() except Exception: -- cgit v1.2.1