ThirdParty/Pygments/pygments/formatters/html.py

branch
Py2 comp.
changeset 3079
0233bbe9a9c4
parent 2525
8b507a9a2d40
child 4172
4f20dba37ab6
--- a/ThirdParty/Pygments/pygments/formatters/html.py	Wed Nov 06 19:50:24 2013 +0100
+++ b/ThirdParty/Pygments/pygments/formatters/html.py	Wed Nov 13 23:30:59 2013 +0100
@@ -9,7 +9,10 @@
     :license: BSD, see LICENSE for details.
 """
 
-from __future__ import unicode_literals    # __IGNORE_WARNING__
+try:
+    basestring    # __IGNORE_WARNING__
+except NameError:
+    basestring = str
 
 import os
 import sys
@@ -455,7 +458,7 @@
         """
         if arg is None:
             arg = ('cssclass' in self.options and '.'+self.cssclass or '')
-        if isinstance(arg, str):
+        if isinstance(arg, basestring):
             args = [arg]
         else:
             args = list(arg)
@@ -507,8 +510,8 @@
                     cssfilename = os.path.join(os.path.dirname(filename),
                                                self.cssfile)
                 except AttributeError:
-                    print('Note: Cannot determine output file name, ' \
-                          'using current directory as base for the CSS file name', file=sys.stderr)
+                    sys.stderr.write('Note: Cannot determine output file name, ' \
+                          'using current directory as base for the CSS file name')
                     cssfilename = self.cssfile
             # write CSS file only if noclobber_cssfile isn't given as an option.
             try:

eric ide

mercurial