summaryrefslogtreecommitdiff
path: root/pygments/__init__.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-14 16:47:28 +0100
committerGeorg Brandl <georg@python.org>2016-02-14 16:47:28 +0100
commit2882c34a141f4f36ded54d1473c6d4f73684ffc7 (patch)
tree3b7f7d5eb6bd3e74d75e44018439f568ad2cf1aa /pygments/__init__.py
parent9ae620fdadc8ca9ad56317754b3d9587f57a6d15 (diff)
downloadpygments-2882c34a141f4f36ded54d1473c6d4f73684ffc7.tar.gz
some pep8 fixups
Diffstat (limited to 'pygments/__init__.py')
-rw-r--r--pygments/__init__.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/pygments/__init__.py b/pygments/__init__.py
index e825aa39..ffac59ef 100644
--- a/pygments/__init__.py
+++ b/pygments/__init__.py
@@ -25,6 +25,9 @@
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+import sys
+
+from pygments.util import StringIO, BytesIO
__version__ = '2.2a0'
__docformat__ = 'restructuredtext'
@@ -32,11 +35,6 @@ __docformat__ = 'restructuredtext'
__all__ = ['lex', 'format', 'highlight']
-import sys
-
-from pygments.util import StringIO, BytesIO
-
-
def lex(code, lexer):
"""
Lex ``code`` with ``lexer`` and return an iterable of tokens.
@@ -44,9 +42,9 @@ def lex(code, lexer):
try:
return lexer.get_tokens(code)
except TypeError as err:
- if isinstance(err.args[0], str) and \
- ('unbound method get_tokens' in err.args[0] or
- 'missing 1 required positional argument' in err.args[0]):
+ if (isinstance(err.args[0], str) and
+ ('unbound method get_tokens' in err.args[0] or
+ 'missing 1 required positional argument' in err.args[0])):
raise TypeError('lex() argument must be a lexer instance, '
'not a class')
raise
@@ -68,9 +66,9 @@ def format(tokens, formatter, outfile=None): # pylint: disable=redefined-builti
else:
formatter.format(tokens, outfile)
except TypeError as err:
- if isinstance(err.args[0], str) and \
- ('unbound method format' in err.args[0] or
- 'missing 1 required positional argument' in err.args[0]):
+ if (isinstance(err.args[0], str) and
+ ('unbound method format' in err.args[0] or
+ 'missing 1 required positional argument' in err.args[0])):
raise TypeError('format() argument must be a formatter instance, '
'not a class')
raise