diff options
author | Georg Brandl <georg@python.org> | 2012-02-04 10:20:03 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-02-04 10:20:03 +0100 |
commit | d3515a13a28b35df9e9cfe8d743968d37d419b4f (patch) | |
tree | d6217ed77e551134bee49a67209eeadef50ab1e1 /pygments/lexer.py | |
parent | cfcc1c299170306cb93a4ddcd9b10df113e1f9f8 (diff) | |
download | pygments-d3515a13a28b35df9e9cfe8d743968d37d419b4f.tar.gz |
Fix subclassing of regex lexers with their own token defs.
Diffstat (limited to 'pygments/lexer.py')
-rw-r--r-- | pygments/lexer.py | 2 |
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: |