# HG changeset patch # User Augie Fackler # Date 2017-12-08 21:14:19 # Node ID 169d66db592023df8f90b2199db4b9ae2cb44086 # Parent 4937db58b663faa6893c51a41cec28114a165dd0 highlight: eagerly discover plugin lexers while demandimport is off Since highlight is only relevant for servers, it seems worthwhile to just trigger this eagerly, which avoids really weird traceback problems caused by demandimport messing with some of the lexer plugins. Differential Revision: https://phab.mercurial-scm.org/D1619 diff --git a/hgext/highlight/highlight.py b/hgext/highlight/highlight.py --- a/hgext/highlight/highlight.py +++ b/hgext/highlight/highlight.py @@ -22,8 +22,12 @@ with demandimport.deactivated(): import pygments import pygments.formatters import pygments.lexers + import pygments.plugin import pygments.util + for unused in pygments.plugin.find_plugin_lexers(): + pass + highlight = pygments.highlight ClassNotFound = pygments.util.ClassNotFound guess_lexer = pygments.lexers.guess_lexer