ThirdParty/Pygments/pygments/util.py

branch
Py2 comp.
changeset 2669
11a6696ff868
parent 2525
8b507a9a2d40
child 3145
a9de05d4a22f
equal deleted inserted replaced
2607:e5115553185a 2669:11a6696ff868
8 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. 8 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
9 :license: BSD, see LICENSE for details. 9 :license: BSD, see LICENSE for details.
10 """ 10 """
11 11
12 from __future__ import unicode_literals # __IGNORE_WARNING__ 12 from __future__ import unicode_literals # __IGNORE_WARNING__
13 try:
14 chr = unichr
15 except (NameError):
16 pass
13 17
14 import re 18 import re
15 import sys 19 import sys
16 import codecs 20 import codecs
17 21
256 # Python 2/3 compatibility 260 # Python 2/3 compatibility
257 261
258 if sys.version_info < (3,0): 262 if sys.version_info < (3,0):
259 b = bytes = str 263 b = bytes = str
260 u_prefix = 'u' 264 u_prefix = 'u'
261 import io, io 265 import StringIO, cStringIO
262 BytesIO = io.StringIO 266 BytesIO = cStringIO.StringIO
263 StringIO = io.StringIO 267 StringIO = StringIO.StringIO
264 uni_open = codecs.open 268 uni_open = codecs.open
265 else: 269 else:
266 import builtins 270 import builtins
267 bytes = builtins.bytes 271 bytes = builtins.bytes
268 u_prefix = '' 272 u_prefix = ''

eric ide

mercurial