diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-02-28 10:27:08 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-02-28 23:07:08 +0100 |
commit | ef1860e39a634696eb6e457cb0cafba95324f53f (patch) | |
tree | 314636dd660efcd06aa8d5e7f041dfc0100fa116 | |
parent | man/emerge.1: use repo names or aliases with --sync (diff) | |
download | portage-ef1860e3.tar.gz portage-ef1860e3.tar.bz2 portage-ef1860e3.zip |
vartree: Use hashlib lazy-import, kill py<2.5 compat
-rw-r--r-- | pym/portage/dbapi/vartree.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5053801e6..2a612d162 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1,4 +1,4 @@ -# Copyright 1998-2014 Gentoo Foundation +# Copyright 1998-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import division, unicode_literals @@ -9,6 +9,7 @@ __all__ = [ import portage portage.proxy.lazyimport.lazyimport(globals(), + 'hashlib:md5', 'portage.checksum:_perform_md5_merge@perform_md5', 'portage.data:portage_gid,portage_uid,secpass', 'portage.dbapi.dep_expand:dep_expand', @@ -1118,11 +1119,7 @@ class vardbapi(dbapi): packages that own it. This is used to optimize owner lookups by narrowing the search down to a smaller number of packages. """ - try: - from hashlib import md5 as _new_hash - except ImportError: - from md5 import new as _new_hash - + _new_hash = md5 _hash_bits = 16 _hex_chars = _hash_bits // 4 |