[PATCH] pygmentsutils: don't fail if an extension doesn't speficy EXTRA_LEXERS

Andrew Shadura andrew at shadura.me
Wed Apr 5 07:07:12 UTC 2017


On 5 April 2017 at 02:16, Mads Kiilerich <mads at kiilerich.com> wrote:
> That's a lot of checking before doing. I wonder if it would be cleaner to do
> something like:
>
> _lexer_name = getattr(kallithea.EXTENSIONS, 'EXTRA_LEXERS',
> {}).get(extension)
> if _lexer_name is not None:
>     ...
>
> If you agree, I can tweak it to that.

Indeed, that looks better. Please go ahead :)

-- 
Cheers,
  Andrew


More information about the kallithea-general mailing list