summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-11-20 09:45:05 +0100
committerGeorg Brandl <georg@python.org>2010-11-20 09:45:05 +0100
commitde0cf8f665c6e12704a58c4856e0da191aa3bc34 (patch)
treef4c288f27221b044bb809ffa6488799228765854
parent35258f2c46068cc7e5019118d157d55a9f2d2524 (diff)
downloadsphinx-git-de0cf8f665c6e12704a58c4856e0da191aa3bc34.tar.gz
Fix calling all serializers with pickle.HIGHEST_PROTOCOL argument.
-rw-r--r--sphinx/builders/html.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 3d4370530..6e8279f7c 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -931,6 +931,8 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):
#: (pickle, simplejson etc.)
implementation = None
implementation_dumps_unicode = False
+ #: additional arguments for dump()
+ additional_dump_args = ()
#: the filename for the global context file
globalcontext_filename = None
@@ -959,8 +961,7 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder):
else:
f = open(filename, 'wb')
try:
- # XXX: the third argument is pickle-specific!
- self.implementation.dump(context, f, 2)
+ self.implementation.dump(context, f, *self.additional_dump_args)
finally:
f.close()
@@ -1011,6 +1012,7 @@ class PickleHTMLBuilder(SerializingHTMLBuilder):
"""
implementation = pickle
implementation_dumps_unicode = False
+ additional_dump_args = (pickle.HIGHEST_PROTOCOL,)
indexer_format = pickle
indexer_dumps_unicode = False
name = 'pickle'