Restore compatibility with Python 2.6
authorBernie Innocenti <bernie@codewiz.org>
Fri, 24 Apr 2009 08:29:12 +0000 (17:29 +0900)
committerBernie Innocenti <bernie@codewiz.org>
Fri, 24 Apr 2009 08:29:12 +0000 (17:29 +0900)
geekigeeki.py

index d208bb723fa672890c99155a6791d93d921c29da..fbf3d93e96b3e1ac322b19055aed56c7d7b3e159 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3.0
+#!/usr/bin/python
 # -*- coding: utf-8 -*-
 #
 # Copyright 1999, 2000 Martin Pool <mbp@humbug.org.au>
@@ -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('</p><p>')
                 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('</pre>')