From 06138ad4c2b0246506dc5e4b406d0e9650427beb Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 24 Dec 2014 12:13:24 -0700 Subject: Fixed make_man_page.py so it works with both python2 and python3. Closes #251. --- man/make_man_page.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'man/make_man_page.py') 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('^\/\*\* ?') -- cgit v1.2.3