Mercurial > hg
changeset 31374:d30fb3de4b40
config: avoid using a mutable default
Nothing *currently* mutates this list, but the moment something does it'll be
shared between all config instances. Avoid this eventuality.
author | Martijn Pieters <mjpieters@fb.com> |
---|---|
date | Sun, 12 Mar 2017 12:56:12 -0700 |
parents | 7548522742b5 |
children | d57aa655ce97 |
files | mercurial/config.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/config.py Fri Aug 05 14:09:04 2016 +0200 +++ b/mercurial/config.py Sun Mar 12 12:56:12 2017 -0700 @@ -18,11 +18,11 @@ ) class config(object): - def __init__(self, data=None, includepaths=[]): + def __init__(self, data=None, includepaths=None): self._data = {} self._source = {} self._unset = [] - self._includepaths = includepaths + self._includepaths = includepaths or [] if data: for k in data._data: self._data[k] = data[k].copy()