summaryrefslogtreecommitdiff
path: root/pygments/lexer.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-02-04 10:20:03 +0100
committerGeorg Brandl <georg@python.org>2012-02-04 10:20:03 +0100
commitd3515a13a28b35df9e9cfe8d743968d37d419b4f (patch)
treed6217ed77e551134bee49a67209eeadef50ab1e1 /pygments/lexer.py
parentcfcc1c299170306cb93a4ddcd9b10df113e1f9f8 (diff)
downloadpygments-d3515a13a28b35df9e9cfe8d743968d37d419b4f.tar.gz
Fix subclassing of regex lexers with their own token defs.
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r--pygments/lexer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pygments/lexer.py b/pygments/lexer.py
index 53ea5ac1..33427ae3 100644
--- a/pygments/lexer.py
+++ b/pygments/lexer.py
@@ -439,7 +439,7 @@ class RegexLexerMeta(LexerMeta):
def __call__(cls, *args, **kwds):
"""Instantiate cls after preprocessing its token definitions."""
- if not hasattr(cls, '_tokens'):
+ if '_tokens' not in cls.__dict__:
cls._all_tokens = {}
cls._tmpname = 0
if hasattr(cls, 'token_variants') and cls.token_variants: