From 123ed0d72aee3ba2f46dfb7e9adbb0f6367e217a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 5 Sep 2010 01:47:20 -0700 Subject: [PATCH] Use lazy imports for CacheError and OrderedDict in the base portage module. --- pym/portage/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index cd1ad6875..e3b3cabfa 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -57,15 +57,10 @@ except ImportError as e: try: - try: - from collections import OrderedDict - except ImportError: - from portage.cache.mappings import OrderedDict - - from portage.cache.cache_errors import CacheError import portage.proxy.lazyimport import portage.proxy as proxy proxy.lazyimport.lazyimport(globals(), + 'portage.cache.cache_errors:CacheError', 'portage.checksum', 'portage.checksum:perform_checksum,perform_md5,prelink_capable', 'portage.cvstree', @@ -133,6 +128,12 @@ try: 'portage.xpak', ) + try: + from collections import OrderedDict + except ImportError: + proxy.lazyimport.lazyimport(globals(), + 'portage.cache.mappings:OrderedDict') + import portage.const from portage.const import VDB_PATH, PRIVATE_PATH, CACHE_PATH, DEPCACHE_PATH, \ USER_CONFIG_PATH, MODULES_FILE_PATH, CUSTOM_PROFILE_PATH, PORTAGE_BASE_PATH, \ -- 2.26.2