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/dbapi/
Date: Tue, 28 Feb 2017 22:07:20
Message-Id: 1488319628.ef1860e39a634696eb6e457cb0cafba95324f53f.mgorny@gentoo
1 commit: ef1860e39a634696eb6e457cb0cafba95324f53f
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 28 09:27:08 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 28 22:07:08 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ef1860e3
7
8 vartree: Use hashlib lazy-import, kill py<2.5 compat
9
10 pym/portage/dbapi/vartree.py | 9 +++------
11 1 file changed, 3 insertions(+), 6 deletions(-)
12
13 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
14 index 5053801e6..2a612d162 100644
15 --- a/pym/portage/dbapi/vartree.py
16 +++ b/pym/portage/dbapi/vartree.py
17 @@ -1,4 +1,4 @@
18 -# Copyright 1998-2014 Gentoo Foundation
19 +# Copyright 1998-2017 Gentoo Foundation
20 # Distributed under the terms of the GNU General Public License v2
21
22 from __future__ import division, unicode_literals
23 @@ -9,6 +9,7 @@ __all__ = [
24
25 import portage
26 portage.proxy.lazyimport.lazyimport(globals(),
27 + 'hashlib:md5',
28 'portage.checksum:_perform_md5_merge@perform_md5',
29 'portage.data:portage_gid,portage_uid,secpass',
30 'portage.dbapi.dep_expand:dep_expand',
31 @@ -1118,11 +1119,7 @@ class vardbapi(dbapi):
32 packages that own it. This is used to optimize owner lookups
33 by narrowing the search down to a smaller number of packages.
34 """
35 - try:
36 - from hashlib import md5 as _new_hash
37 - except ImportError:
38 - from md5 import new as _new_hash
39 -
40 + _new_hash = md5
41 _hash_bits = 16
42 _hex_chars = _hash_bits // 4