From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RAF7K-0005xS-Jc for garchives@archives.gentoo.org; Sun, 02 Oct 2011 06:01:38 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A4E821C0EC; Sun, 2 Oct 2011 06:01:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3936121C0EC for ; Sun, 2 Oct 2011 06:01:31 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8C2421B4004 for ; Sun, 2 Oct 2011 06:01:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B5A0080042 for ; Sun, 2 Oct 2011 06:01:29 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <06ad8911b5790a2ed963fe1b981751ab0a2be8d5.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/checksum.py X-VCS-Directories: pym/portage/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 06ad8911b5790a2ed963fe1b981751ab0a2be8d5 Date: Sun, 2 Oct 2011 06:01:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 0447bb7c377054752d73597ced8023c9 commit: 06ad8911b5790a2ed963fe1b981751ab0a2be8d5 Author: Zac Medico gentoo org> AuthorDate: Sun Oct 2 06:01:17 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Oct 2 06:01:17 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D06ad8911 checksum.py: lazily import bundled whirlpool --- pym/portage/checksum.py | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py index a4a744b..080a6df 100644 --- a/pym/portage/checksum.py +++ b/pym/portage/checksum.py @@ -76,10 +76,6 @@ except ImportError: =20 sha1hash =3D _generate_hash_function("SHA1", _new_sha1, origin=3D"intern= al") =20 -# Bundled WHIRLPOOL implementation -from portage.util.whirlpool import new as _new_whirlpool -whirlpoolhash =3D _generate_hash_function("WHIRLPOOL", _new_whirlpool, o= rigin=3D"bundled") - # Try to use mhash if available # mhash causes GIL presently, so it gets less priority than hashlib and # pycrypto. However, it might be the only accelerated implementation of @@ -104,7 +100,7 @@ try: from Crypto.Hash import SHA256, RIPEMD sha256hash =3D _generate_hash_function("SHA256", SHA256.new, origin=3D"= pycrypto") rmd160hash =3D _generate_hash_function("RMD160", RIPEMD.new, origin=3D"= pycrypto") -except ImportError as e: +except ImportError: pass =20 # Use hashlib from python-2.5 if available and prefer it over pycrypto a= nd internal fallbacks. @@ -127,9 +123,13 @@ try: functools.partial(hashlib.new, hash_name), \ origin=3D'hashlib') =20 -except ImportError as e: +except ImportError: pass -=09 + +if "WHIRLPOOL" not in hashfunc_map: + # Bundled WHIRLPOOL implementation + from portage.util.whirlpool import new as _new_whirlpool + whirlpoolhash =3D _generate_hash_function("WHIRLPOOL", _new_whirlpool, = origin=3D"bundled") =20 # Use python-fchksum if available, prefer it over all other MD5 implemen= tations try: