aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-02-04 12:56:41 -0500
committerMike Frysinger <vapier@gentoo.org>2016-02-04 12:56:41 -0500
commitd63a4b1b586b4a1f5f6d841af582bb7fd1bcecff (patch)
tree69f1462587f084278f6838f2592fd4bd4edea5be
parentqlop: fix crash w/corrupted log files (diff)
downloadportage-utils-d63a4b1b586b4a1f5f6d841af582bb7fd1bcecff.tar.gz
portage-utils-d63a4b1b586b4a1f5f6d841af582bb7fd1bcecff.tar.bz2
portage-utils-d63a4b1b586b4a1f5f6d841af582bb7fd1bcecff.zip
man: get mkman.py working under py2 & py3
-rwxr-xr-xman/mkman.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/man/mkman.py b/man/mkman.py
index cd0fa7a..1ec8584 100755
--- a/man/mkman.py
+++ b/man/mkman.py
@@ -1,4 +1,5 @@
#!/usr/bin/python
+# -*- coding: utf-8 -*-
"""Generate man pages for the q applets"""
@@ -25,7 +26,7 @@ Q = os.path.join(TOPDIR, 'q')
def FindApplets():
"""Return a list of all supported applets"""
applets = os.path.join(TOPDIR, 'applets.sh')
- return subprocess.check_output([applets]).splitlines()
+ return subprocess.check_output([applets]).decode('ascii').splitlines()
COMMON_AUTHORS = [
@@ -61,7 +62,7 @@ def MkMan(applets, applet, output):
# Extract the main use string and description:
# Usage: q <applet> <args> : invoke a portage utility applet
- ahelp = subprocess.check_output([Q, applet, '--help'])
+ ahelp = subprocess.check_output([Q, applet, '--help']).decode('ascii')
lines = ahelp.splitlines()
m = re.search(r'^Usage: %s (.*) : (.*)' % applet, ahelp)
usage = m.group(1)
@@ -77,7 +78,7 @@ def MkMan(applets, applet, output):
# Extract all the options
options = []
- for line, i in zip(lines, xrange(len(lines))):
+ for line, i in zip(lines, range(len(lines))):
if not line.startswith('Options: '):
continue