summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-08-10 16:04:41 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2014-08-10 16:04:41 -0700
commita41a19d14db7108c141e5737c5acdbbdda201af8 (patch)
treee8fc4a356c22bb6dd53e4495daaa1e52dabb8432
parent5a5da817a1041b57cc4ae0f2ee16ee0d75701c57 (diff)
downloadspack-a41a19d14db7108c141e5737c5acdbbdda201af8.tar.gz
spack-a41a19d14db7108c141e5737c5acdbbdda201af8.tar.bz2
spack-a41a19d14db7108c141e5737c5acdbbdda201af8.tar.xz
spack-a41a19d14db7108c141e5737c5acdbbdda201af8.zip
Change dict comprehensions to dict() constructors.
-rw-r--r--lib/spack/spack/compiler.py2
-rw-r--r--lib/spack/spack/compilers/__init__.py2
-rw-r--r--lib/spack/spack/package.py2
-rw-r--r--lib/spack/spack/util/crypto.py2
4 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py
index 716356bdd2..582f49eaf2 100644
--- a/lib/spack/spack/compiler.py
+++ b/lib/spack/spack/compiler.py
@@ -189,7 +189,7 @@ class Compiler(object):
return None
successful = [key for key in parmap(check, checks) if key is not None]
- return { (v, p, s) : path for v, p, s, path in successful }
+ return dict(((v, p, s), path) for v, p, s, path in successful)
@classmethod
def find(cls, *path):
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py
index c5bfe21ed4..467472cced 100644
--- a/lib/spack/spack/compilers/__init__.py
+++ b/lib/spack/spack/compilers/__init__.py
@@ -176,7 +176,7 @@ def compilers_for_spec(compiler_spec):
config = _get_config()
def get_compiler(cspec):
- items = { k:v for k,v in config.items('compiler "%s"' % cspec) }
+ items = dict((k,v) for k,v in config.items('compiler "%s"' % cspec))
if not all(n in items for n in _required_instance_vars):
raise InvalidCompilerConfigurationError(cspec)
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 8df658e660..b0a9dd76b9 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -360,7 +360,7 @@ class Package(object):
# Version-ize the keys in versions dict
try:
- self.versions = { Version(v):h for v,h in self.versions.items() }
+ self.versions = dict((Version(v), h) for v,h in self.versions.items())
except ValueError:
raise ValueError("Keys of versions dict in package %s must be versions!"
% self.name)
diff --git a/lib/spack/spack/util/crypto.py b/lib/spack/spack/util/crypto.py
index 4d8681bed9..950e807596 100644
--- a/lib/spack/spack/util/crypto.py
+++ b/lib/spack/spack/util/crypto.py
@@ -35,7 +35,7 @@ _acceptable_hashes = [
hashlib.sha512 ]
"""Index for looking up hasher for a digest."""
-_size_to_hash = { h().digest_size : h for h in _acceptable_hashes }
+_size_to_hash = dict((h().digest_size, h) for h in _acceptable_hashes)
def checksum(hashlib_algo, filename, **kwargs):