summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-09-07 20:53:59 +0200
committerGitHub <noreply@github.com>2020-09-07 11:53:59 -0700
commit28c6ce97143e9eb02daee9c1e027b07cec2d00c9 (patch)
tree9465db8cb475c54dcbd94ec938af870e9110c0e5 /lib
parentdcee0a1d5dab00068fa84ddf3859ece62d01785a (diff)
downloadspack-28c6ce97143e9eb02daee9c1e027b07cec2d00c9.tar.gz
spack-28c6ce97143e9eb02daee9c1e027b07cec2d00c9.tar.bz2
spack-28c6ce97143e9eb02daee9c1e027b07cec2d00c9.tar.xz
spack-28c6ce97143e9eb02daee9c1e027b07cec2d00c9.zip
SpecList: remove mutable types from __init__ arguments (#18515)
fixes #18439
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/spec_list.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/spack/spack/spec_list.py b/lib/spack/spack/spec_list.py
index bc473f530c..1aa0ab870e 100644
--- a/lib/spack/spack/spec_list.py
+++ b/lib/spack/spack/spec_list.py
@@ -25,7 +25,11 @@ def spec_ordering_key(s):
class SpecList(object):
- def __init__(self, name='specs', yaml_list=[], reference={}):
+ def __init__(self, name='specs', yaml_list=None, reference=None):
+ # Normalize input arguments
+ yaml_list = yaml_list or []
+ reference = reference or {}
+
self.name = name
self._reference = reference # TODO: Do we need defensive copy here?