diff options
author | Georg Brandl <georg@python.org> | 2014-01-18 13:25:15 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-01-18 13:25:15 +0100 |
commit | a9169c157a05c82a1b8a7ffb92e7f159fb4ca0f8 (patch) | |
tree | face5db25ebef227315a0ae1080d4b2262f6fe23 /pygments/formatters/html.py | |
parent | e921fe0b430608cb7e0c89f7fada9260cb4822eb (diff) | |
download | pygments-a9169c157a05c82a1b8a7ffb92e7f159fb4ca0f8.tar.gz |
futurizing: move to print_function and "except X as Y" syntax
Diffstat (limited to 'pygments/formatters/html.py')
-rw-r--r-- | pygments/formatters/html.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pygments/formatters/html.py b/pygments/formatters/html.py index 5e5f1e40..3ac60c4a 100644 --- a/pygments/formatters/html.py +++ b/pygments/formatters/html.py @@ -8,6 +8,7 @@ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ +from __future__ import print_function import os import sys @@ -505,8 +506,8 @@ class HtmlFormatter(Formatter): cssfilename = os.path.join(os.path.dirname(filename), self.cssfile) except AttributeError: - print >>sys.stderr, 'Note: Cannot determine output file name, ' \ - 'using current directory as base for the CSS file name' + print('Note: Cannot determine output file name, ' \ + 'using current directory as base for the CSS file name', file=sys.stderr) cssfilename = self.cssfile # write CSS file only if noclobber_cssfile isn't given as an option. try: @@ -515,7 +516,7 @@ class HtmlFormatter(Formatter): cf.write(CSSFILE_TEMPLATE % {'styledefs': self.get_style_defs('body')}) cf.close() - except IOError, err: + except IOError as err: err.strerror = 'Error writing CSS file: ' + err.strerror raise |