mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
Use a deep copy of the initial_data for a domain so that updates to its internal data structures aren't reflected in initial_data
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
import copy
|
||||
|
||||
from six import iteritems
|
||||
|
||||
from sphinx.errors import SphinxError
|
||||
@@ -145,7 +147,7 @@ class Domain(object):
|
||||
self.env = env
|
||||
if self.name not in env.domaindata:
|
||||
assert isinstance(self.initial_data, dict)
|
||||
new_data = self.initial_data.copy()
|
||||
new_data = copy.deepcopy(self.initial_data)
|
||||
new_data['version'] = self.data_version
|
||||
self.data = env.domaindata[self.name] = new_data
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user