Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/
Date: Wed, 01 Mar 2017 15:43:22
Message-Id: 1488382944.1c7b39c6cb89da22038291ae69528ac5486fd10c.mgorny@gentoo
1 commit: 1c7b39c6cb89da22038291ae69528ac5486fd10c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 28 22:15:20 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 1 15:42:24 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1c7b39c6
7
8 checksum: Fix overriding fallbacks on broken pycrypto
9
10 The pycrypto override used the same variables as actual hash functions
11 before determining whether its functions are useful. As a result, if
12 pycrypto had a broken module and no hash function was generated,
13 the possible previous implementation was replaced by None.
14
15 pym/portage/checksum.py | 12 ++++++------
16 1 file changed, 6 insertions(+), 6 deletions(-)
17
18 diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
19 index a46b820af..fc38417a7 100644
20 --- a/pym/portage/checksum.py
21 +++ b/pym/portage/checksum.py
22 @@ -105,14 +105,14 @@ except ImportError:
23 # is broken somehow.
24 try:
25 from Crypto.Hash import SHA256, RIPEMD
26 - sha256hash = getattr(SHA256, 'new', None)
27 - if sha256hash is not None:
28 + sha256hash_ = getattr(SHA256, 'new', None)
29 + if sha256hash_ is not None:
30 sha256hash = _generate_hash_function("SHA256",
31 - sha256hash, origin="pycrypto")
32 - rmd160hash = getattr(RIPEMD, 'new', None)
33 - if rmd160hash is not None:
34 + sha256hash_, origin="pycrypto")
35 + rmd160hash_ = getattr(RIPEMD, 'new', None)
36 + if rmd160hash_ is not None:
37 rmd160hash = _generate_hash_function("RMD160",
38 - rmd160hash, origin="pycrypto")
39 + rmd160hash_, origin="pycrypto")
40 except ImportError:
41 pass