mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Ensures mutable config defaults are copied
This commit is contained in:
committed by
Waylan Limberg
parent
e76836e1a4
commit
39c81b8a88
@@ -119,7 +119,11 @@ class OptionallyRequired(BaseConfigOption):
|
||||
|
||||
if value is None:
|
||||
if self.default is not None:
|
||||
value = self.default
|
||||
if hasattr(self.default, 'copy'):
|
||||
# ensure no mutable values are assigned
|
||||
value = self.default.copy()
|
||||
else:
|
||||
value = self.default
|
||||
elif not self.required:
|
||||
return
|
||||
elif self.required:
|
||||
|
||||
Reference in New Issue
Block a user