[systemd-commits] make-man-index.py
Kay Sievers
kay at kemper.freedesktop.org
Wed Jul 25 02:27:47 PDT 2012
make-man-index.py | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit b56d18ee605d5dfb0680c154010178d0da2e4af3
Author: Mantas MikulÄnas <grawity at gmail.com>
Date: Wed Jul 25 02:59:28 2012 +0300
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.
diff --git a/make-man-index.py b/make-man-index.py
index 1e67287..8789d99 100755
--- a/make-man-index.py
+++ b/make-man-index.py
@@ -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))
More information about the systemd-commits
mailing list