mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4048 from jdemeyer/unpickle_error
Turn any environment unpickling error into IOError
This commit is contained in:
commit
2f78acb2f9
@ -110,7 +110,12 @@ class BuildEnvironment(object):
|
||||
@staticmethod
|
||||
def load(f, app=None):
|
||||
# type: (IO, Sphinx) -> BuildEnvironment
|
||||
env = pickle.load(f)
|
||||
try:
|
||||
env = pickle.load(f)
|
||||
except Exception as exc:
|
||||
# This can happen for example when the pickle is from a
|
||||
# different version of Sphinx.
|
||||
raise IOError(exc)
|
||||
if env.version != ENV_VERSION:
|
||||
raise IOError('build environment version not current')
|
||||
if app:
|
||||
|
Loading…
Reference in New Issue
Block a user