From: Bernie Innocenti Date: Fri, 24 Apr 2009 08:29:12 +0000 (+0900) Subject: Restore compatibility with Python 2.6 X-Git-Tag: v4.0~14 X-Git-Url: https://codewiz.org/gitweb?p=geekigeeki.git;a=commitdiff_plain;h=4b7c0eb2e64ba9ac910dd57c545c2a455077632b;hp=3f737b8a960486cd16aaa4acacc83acb24c7d42f Restore compatibility with Python 2.6 --- diff --git a/geekigeeki.py b/geekigeeki.py index d208bb7..fbf3d93 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.0 +#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 1999, 2000 Martin Pool @@ -552,7 +552,8 @@ class WikiFormatter: tr_re = re.compile(r"^\s*\|\|") eol_re = re.compile(r"\r?\n") # For each line, we scan through looking for magic strings, outputting verbatim any intervening text - for self.line in eol_re.split(str(self.raw.expandtabs(), 'utf-8')): + #3.0: for self.line in eol_re.split(str(self.raw.expandtabs(), 'utf-8')): + for self.line in eol_re.split(str(self.raw.expandtabs())): # Skip pragmas if self.in_header: if self.line.startswith('#'): @@ -570,7 +571,8 @@ class WikiFormatter: print('

') else: indent = indent_re.match(self.line) - print(self._indent_to(len(indent.group(0))), end=' ') + #3.0: print(self._indent_to(len(indent.group(0))), end=' ') + print(self._indent_to(len(indent.group(0)))) print(re.sub(scan_re, self.replace, self.line)) if self.in_pre: print('')