aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-24 14:46:27 +0100
committerDavid Robillard <d@drobilla.net>2019-03-24 18:01:46 +0100
commit29ca1b7736c1a830784705be9fe2194245989f72 (patch)
treedf18f9cceb9d2a957990d22624c8d47d329abdde
parentc3765cc2644ddd61c497dd54d5262832025e670a (diff)
downloadlv2-29ca1b7736c1a830784705be9fe2194245989f72.tar.xz
Fix documentation comment validation
-rwxr-xr-xlv2specgen/lv2specgen.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index b409ac5..c3ae71c 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -339,22 +339,22 @@ def getComment(m, urinode, classlist, proplist, instalist):
<title>Validation Skeleton Document</title>
</head>
<body>
-%s
+""" + markup + """
</body>
-</html>
-""" % str(markup.decode())
+</html>"""
oldcwd = os.getcwd()
os.chdir(specgendir)
parser = etree.XMLParser(dtd_validation=True, no_network=True)
- root = etree.fromstring(doc, parser)
- os.chdir(oldcwd)
+ root = etree.fromstring(doc.encode('utf-8'), parser)
except Exception as e:
print("Invalid lv2:documentation for %s\n%s" % (urinode, e))
line_num = 1
for line in doc.split('\n'):
print('%3d: %s' % (line_num, line))
line_num += 1
+ finally:
+ os.chdir(oldcwd)
return markup