summaryrefslogtreecommitdiff
path: root/pygments/__init__.py
diff options
context:
space:
mode:
authorgbrandl <devnull@localhost>2009-03-31 10:26:55 -0500
committergbrandl <devnull@localhost>2009-03-31 10:26:55 -0500
commit7b95efab48d9ec79e995bf4d6db10fd049e3395a (patch)
tree48fc9b840dab83976a85af85d1c705dbaa051a0b /pygments/__init__.py
parentf12c878ed096137c91658a0f62f0070e08c2afea (diff)
downloadpygments-7b95efab48d9ec79e995bf4d6db10fd049e3395a.tar.gz
Port Pygments to Python 3.1.
Diffstat (limited to 'pygments/__init__.py')
-rw-r--r--pygments/__init__.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/pygments/__init__.py b/pygments/__init__.py
index 31efe660..2e63f988 100644
--- a/pygments/__init__.py
+++ b/pygments/__init__.py
@@ -24,18 +24,15 @@
:license: BSD, see LICENSE for details.
"""
-__version__ = '1.0'
-__author__ = 'Georg Brandl <g.brandl@gmx.net>'
-__url__ = 'http://pygments.org/'
-__license__ = 'BSD License'
+__version__ = '1.1'
__docformat__ = 'restructuredtext'
__all__ = ['lex', 'format', 'highlight']
import sys, os
-from StringIO import StringIO
-from cStringIO import StringIO as CStringIO
+
+from pygments.util import StringIO, BytesIO
def lex(code, lexer):
@@ -62,8 +59,8 @@ def format(tokens, formatter, outfile=None):
"""
try:
if not outfile:
- # if we want Unicode output, we have to use Python StringIO
- realoutfile = formatter.encoding and CStringIO() or StringIO()
+ #print formatter, 'using', formatter.encoding
+ realoutfile = formatter.encoding and BytesIO() or StringIO()
formatter.format(tokens, realoutfile)
return realoutfile.getvalue()
else: