From 20f625b4d39d0e981b4922f629212acc74271665 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 11 Jun 2018 02:27:27 +0200 Subject: [PATCH] Builder.build: save env also with only new documents Saving/pickling the environment is necessary for intersphinx to have its cache saved. Currently a new build would fetch the inventories, but the cache would not get saved. This appears to break no existing test, but should probably get a new one then? --- sphinx/builders/__init__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 7cfacbd3c95..e446ca94a9b 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -372,14 +372,14 @@ def build(self, docnames, summary=None, method='update'): else: logger.info(__('none found')) - if updated_docnames: - # save the environment - from sphinx.application import ENV_PICKLE_FILENAME - logger.info(bold(__('pickling environment... ')), nonl=True) - with open(path.join(self.doctreedir, ENV_PICKLE_FILENAME), 'wb') as f: - pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL) - logger.info(__('done')) + # save the environment + from sphinx.application import ENV_PICKLE_FILENAME + logger.info(bold(__('pickling environment... ')), nonl=True) + with open(path.join(self.doctreedir, ENV_PICKLE_FILENAME), 'wb') as f: + pickle.dump(self.env, f, pickle.HIGHEST_PROTOCOL) + logger.info(__('done')) + if updated_docnames: # global actions self.app.phase = BuildPhase.CONSISTENCY_CHECK logger.info(bold(__('checking consistency... ')), nonl=True)