diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index 73e01b5..7fadc60 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -184,10 +184,8 @@ def _perform_md5_merge(x, **kwargs): encoding=_encodings['merge'], errors='strict'), **kwargs) def perform_all(x, calc_prelink=0): - mydict = {} - for k in hashfunc_map: - mydict[k] = perform_checksum(x, hashfunc_map[k], calc_prelink)[0] - return mydict + return dict( (k, perform_checksum(x, k, calc_prelink)[0]) + for k in hashfunc_map.keys() ) def get_valid_checksum_keys(): return list(hashfunc_map) @@ -301,8 +299,9 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0): prelink_capable = False try: if hashname not in hashfunc_map: - raise portage.exception.DigestException(hashname + \ - " hash function not available (needs dev-python/pycrypto)") + raise portage.exception.DigestException( + "%s hash function not available (needs dev-python/pycrypto)" + % hashname ) myhash, mysize = hashfunc_map[hashname](myfilename) except (OSError, IOError) as e: if e.errno in (errno.ENOENT, errno.ESTALE):