chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
669241a
)
make-man-index.py: compatibility with Python 3
author
Mantas Mikulėnas
<grawity@gmail.com>
Tue, 24 Jul 2012 23:59:28 +0000
(
02:59
+0300)
committer
Kay Sievers
<kay@vrfy.org>
Wed, 25 Jul 2012 09:26:22 +0000
(11:26 +0200)
Despite its name, ElementTree.tostring() returns already-encoded
bytes() instead of a string in Python 3; sys.stdout doesn't like that.
make-man-index.py
patch
|
blob
|
history
diff --git
a/make-man-index.py
b/make-man-index.py
index 1e67287c08482b5f01899ae9bccf6fc3fba5331b..8789d995eca021fbe1e427f4e20bcef27a729e02 100755
(executable)
--- 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))