Change dict comprehensions to dict() constructors.
This commit is contained in:
		@@ -189,7 +189,7 @@ def check(key):
 | 
			
		||||
                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):
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -360,7 +360,7 @@ def sanity_check_dict(attr_name):
 | 
			
		||||
 | 
			
		||||
        # 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)
 | 
			
		||||
 
 | 
			
		||||
@@ -35,7 +35,7 @@
 | 
			
		||||
    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):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user