1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

make-man-index.py: compatibility with Python 3

Despite its name, ElementTree.tostring() returns already-encoded
bytes() instead of a string in Python 3; sys.stdout doesn't like that.
This commit is contained in:
Mantas Mikulėnas 2012-07-25 02:59:28 +03:00 committed by Kay Sievers
parent 669241a076
commit b56d18ee60

View File

@ -72,5 +72,7 @@ hr = SubElement(body, 'hr')
p = SubElement(body, 'p')
p.text = "This index contains %s entries, referring to %i individual manual pages." % (len(index), len(argv)-1)
if hasattr(stdout, "buffer"):
stdout = stdout.buffer
prettify(html)
stdout.write(tostring(html))