Changeset - f9b67a894e21
[Not reviewed]
default
0 1 0
Andrew Shadura - 9 years ago 2017-04-04 16:54:35
andrew@shadura.me
pygmentsutils: don't fail if an extension doesn't speficy EXTRA_LEXERS
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/pygmentsutils.py
Show inline comments
 
@@ -86,7 +86,7 @@ def get_custom_lexer(extension):
 
    if there's no custom lexer defined
 
    """
 
    import kallithea
 
    #check if we didn't define this extension as other lexer
 
    if kallithea.EXTENSIONS and extension in kallithea.EXTENSIONS.EXTRA_LEXERS:
 
        _lexer_name = kallithea.EXTENSIONS.EXTRA_LEXERS[extension]
 
        return lexers.get_lexer_by_name(_lexer_name)
 
    lexer_name = getattr(kallithea.EXTENSIONS, 'EXTRA_LEXERS', {}).get(extension)
 
    if lexer_name is None:
 
        return None
 
    return lexers.get_lexer_by_name(lexer_name)
0 comments (0 inline, 0 general)