summaryrefslogtreecommitdiffstats
path: root/pym/portage/checksum.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-08 05:12:04 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-08 05:12:04 +0000
commit81739be6afceb08ab2b47416634fa2eca79840ba (patch)
treee23d4ddb93d10244345e9b0b776d5c4df108d355 /pym/portage/checksum.py
parentb2f120b00424d222530f4a9ba0bd39fb87353527 (diff)
downloadportage-81739be6afceb08ab2b47416634fa2eca79840ba.tar.gz
portage-81739be6afceb08ab2b47416634fa2eca79840ba.tar.bz2
portage-81739be6afceb08ab2b47416634fa2eca79840ba.zip
With python-2.6, importing the Crypto.Hash.MD5 and Crypto.Hash.SHA modules
from pycrypto triggers warnings since those modules are implemented using the deprecated md5 and sha modules from python's stdlib. So, in order to avoid the warning and the inferior hash implementations that come with them, never use these particular modules from pycrypto. Instead, use hashlib or directly use stdlib's md5 and sha modules if necessary. Thanks to Markus Peloquin for reporting. svn path=/main/trunk/; revision=11828
Diffstat (limited to 'pym/portage/checksum.py')
-rw-r--r--pym/portage/checksum.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
index 8364d26ed..56719a1df 100644
--- a/pym/portage/checksum.py
+++ b/pym/portage/checksum.py
@@ -61,10 +61,7 @@ sha1hash = _generate_hash_function("SHA1", _new_sha1, origin="internal")
# Use pycrypto when available, prefer it over the internal fallbacks
try:
- from Crypto.Hash import MD5, SHA, SHA256, RIPEMD
-
- md5hash = _generate_hash_function("MD5", MD5.new, origin="pycrypto")
- sha1hash = _generate_hash_function("SHA1", SHA.new, origin="pycrypto")
+ from Crypto.Hash import SHA256, RIPEMD
sha256hash = _generate_hash_function("SHA256", SHA256.new, origin="pycrypto")
rmd160hash = _generate_hash_function("RMD160", RIPEMD.new, origin="pycrypto")
except ImportError, e: