summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-24 12:13:24 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-24 12:13:24 -0700
commit06138ad4c2b0246506dc5e4b406d0e9650427beb (patch)
tree18f5e906b9ad4340103ccd5856fe1f6b1839d823 /man
parent8b44dab7b3465445ac4137dc7893665f2336024b (diff)
Fixed make_man_page.py so it works with both python2 and python3.
Closes #251.
Diffstat (limited to 'man')
-rw-r--r--man/make_man_page.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/man/make_man_page.py b/man/make_man_page.py
index e7c5f69..a2c8980 100644
--- a/man/make_man_page.py
+++ b/man/make_man_page.py
@@ -34,7 +34,13 @@ render_man.restype = c_char_p
render_man.argtypes = [c_void_p]
def md2man(text):
- return render_man(parse_document(text, len(text)))
+ if sys.version_info >= (3,0):
+ textbytes = text.encode('utf-8')
+ textlen = len(textbytes)
+ else:
+ textbytes = text
+ textlen = len(text)
+ return render_man(parse_document(textbytes, textlen))
comment_start_re = re.compile('^\/\*\* ?')