mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix SerializingHTMLBuilder has been crashed if jinja2 helper functions are installed.
This commit is contained in:
parent
76acc4775a
commit
1013038b02
@ -13,6 +13,7 @@ import codecs
|
||||
import posixpath
|
||||
import re
|
||||
import sys
|
||||
import types
|
||||
import warnings
|
||||
from hashlib import md5
|
||||
from os import path
|
||||
@ -1410,6 +1411,11 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):
|
||||
# actually rendered
|
||||
self.app.emit('html-page-context', pagename, templatename, ctx, event_arg)
|
||||
|
||||
# make context object serializable
|
||||
for key in list(ctx):
|
||||
if isinstance(ctx[key], types.FunctionType):
|
||||
del ctx[key]
|
||||
|
||||
ensuredir(path.dirname(outfilename))
|
||||
self.dump_context(ctx, outfilename)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user