# HG changeset patch # User Pierre-Yves David # Date 2015-09-24 08:04:58 # Node ID ec4f3755d997c190bf16c6603e986192f687b8bc # Parent d9537ce64f3af401b5cfafa1369ed93831c3b10d templater: remove a mutable default argument Mutable default arguments are know to the state of California to cause bugs. diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -792,8 +792,10 @@ class engine(object): filter uses function to transform value. syntax is {key|filter1|filter2|...}.''' - def __init__(self, loader, filters={}, defaults={}): + def __init__(self, loader, filters=None, defaults={}): self._loader = loader + if filters is None: + filters = {} self._filters = filters self._defaults = defaults self._cache = {}