diff --git a/CHANGES b/CHANGES index 7cc7cd809..632280ee3 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,8 @@ Bugs fixed attributes of Enum class correctly. * #3261: ``latex_use_parts`` makes sphinx crash * The warning type ``misc.highlighting_failure`` does not work +* #3294: ``add_latex_package()`` make crashes non-LaTeX builders + Release 1.5.1 (released Dec 13, 2016) ===================================== diff --git a/sphinx/application.py b/sphinx/application.py index 00661aa61..f3bc381bc 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -806,7 +806,8 @@ class Sphinx(object): def add_latex_package(self, packagename, options=None): self.debug('[app] adding latex package: %r', packagename) - self.builder.usepackages.append((packagename, options)) + if hasattr(self.builder, 'usepackages'): # only for LaTeX builder + self.builder.usepackages.append((packagename, options)) def add_lexer(self, alias, lexer): self.debug('[app] adding lexer: %r', (alias, lexer))