From 93972ff3f135cf344abad49dc62c257a4f956f8e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 19 Feb 2018 07:12:27 +0100 Subject: [PATCH] Copy value before watching it for mutations in config If we copy it afterwards, we are going to mutate the copied object. --- qutebrowser/config/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index d1f8b2b44..7cfd326d3 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -352,12 +352,13 @@ class Config(QObject): return obj value = self._values[name].get_for_pattern(pattern) + value = self._maybe_copy(value) # Watch the returned object for changes if it's mutable. if isinstance(value, self.MUTABLE_TYPES): self._mutables[name] = (copy.deepcopy(value), value) - return self._maybe_copy(value) + return value def get_str(self, name, *, pattern=None): """Get the given setting as string.