summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2013-12-09 10:44:46 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2013-12-09 10:44:46 -0800
commit8d51c95e68144c3b82347b3e41b42e49a4d05121 (patch)
treecc5738875cb103a2d2b2f28aa8d0840c56f41887
parent936f54761b50d0c0680852a4a8724dd31328bfba (diff)
downloadspack-8d51c95e68144c3b82347b3e41b42e49a4d05121.tar.gz
spack-8d51c95e68144c3b82347b3e41b42e49a4d05121.tar.bz2
spack-8d51c95e68144c3b82347b3e41b42e49a4d05121.tar.xz
spack-8d51c95e68144c3b82347b3e41b42e49a4d05121.zip
use get instead of setdefault for kwargs.
-rw-r--r--lib/spack/spack/spec.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py
index 358343e3bb..d7c642a81e 100644
--- a/lib/spack/spack/spec.py
+++ b/lib/spack/spack/spec.py
@@ -397,10 +397,10 @@ class Spec(object):
root [=True]
If false, this won't yield the root node, just its descendents.
"""
- depth = kwargs.setdefault('depth', False)
- key_fun = kwargs.setdefault('key', id)
- yield_root = kwargs.setdefault('root', True)
- cover = kwargs.setdefault('cover', 'nodes')
+ depth = kwargs.get('depth', False)
+ key_fun = kwargs.get('key', id)
+ yield_root = kwargs.get('root', True)
+ cover = kwargs.get('cover', 'nodes')
cover_values = ('nodes', 'edges', 'paths')
if cover not in cover_values: