Mercurial > hg-stable
changeset 26331:2c6a741bf05e
templater: remove a mutable default argument
Mutable default arguments are know to the state of California to cause bugs.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 24 Sep 2015 01:05:21 -0700 |
parents | ec4f3755d997 |
children | 66221730d372 |
files | mercurial/templater.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/templater.py Thu Sep 24 01:04:58 2015 -0700 +++ b/mercurial/templater.py Thu Sep 24 01:05:21 2015 -0700 @@ -792,11 +792,13 @@ filter uses function to transform value. syntax is {key|filter1|filter2|...}.''' - def __init__(self, loader, filters=None, defaults={}): + def __init__(self, loader, filters=None, defaults=None): self._loader = loader if filters is None: filters = {} self._filters = filters + if defaults is None: + defaults = {} self._defaults = defaults self._cache = {}