diff MoinMoin/support/pygments/formatters/terminal.py @ 6009:b48a69886ca4

upgrade bundled pygments to 1.6
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 05 Jan 2014 02:49:41 +0100
parents 74fa6f714526
children 815981fad7fd
line wrap: on
line diff
--- a/MoinMoin/support/pygments/formatters/terminal.py	Sun Jan 05 02:43:02 2014 +0100
+++ b/MoinMoin/support/pygments/formatters/terminal.py	Sun Jan 05 02:49:41 2014 +0100
@@ -5,10 +5,12 @@
 
     Formatter for terminal output with ANSI sequences.
 
-    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
+import sys
+
 from pygments.formatter import Formatter
 from pygments.token import Keyword, Name, Comment, String, Error, \
      Number, Operator, Generic, Token, Whitespace
@@ -86,7 +88,8 @@
         # hack: if the output is a terminal and has an encoding set,
         # use that to avoid unicode encode problems
         if not self.encoding and hasattr(outfile, "encoding") and \
-           hasattr(outfile, "isatty") and outfile.isatty():
+           hasattr(outfile, "isatty") and outfile.isatty() and \
+           sys.version_info < (3,):
             self.encoding = outfile.encoding
         return Formatter.format(self, tokensource, outfile)