Restored automatic skipping of environment pickling.

This commit is contained in:
Ahmet Bakan 2015-05-03 07:15:03 -07:00
parent 570e046e00
commit 7ea98e41e9

View file

@ -228,11 +228,13 @@ def skip_pickling(env):
del self.config[key] del self.config[key]
print('Trying to pickle:') print('Trying to pickle:')
try_pickling(env) try_pickling(env)
#from code import interact; interact(local=locals())
# reset attributes # reset attributes
self.domains = domains self.domains = domains
self.config.values = values self.config.values = values
self.set_warnfunc(warnfunc) self.set_warnfunc(warnfunc)
#from code import interact; interact(local=locals())
#try_pickling(env) #try_pickling(env)
tried.add(id(topickle)) tried.add(id(topickle))
env.topickle = topickle env.topickle = topickle
@ -245,8 +247,9 @@ def process_posts(app, doctree):
environment.""" environment."""
env = app.builder.env env = app.builder.env
if os.environ.get('READTHEDOCS', None) == 'True' or 1: if os.environ.get('READTHEDOCS', None):
skip_pickling(env) env.topickle = lambda *args: env.warn('index',
'Building on Read The Docs, environment is not being pickled.')
if not hasattr(env, 'ablog_posts'): if not hasattr(env, 'ablog_posts'):
env.ablog_posts = {} env.ablog_posts = {}