ebuild_xattr: lazily import xattr
authorZac Medico <zmedico@gentoo.org>
Mon, 31 Jan 2011 07:46:45 +0000 (23:46 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 31 Jan 2011 07:46:45 +0000 (23:46 -0800)
pym/portage/cache/ebuild_xattr.py
pym/portage/tests/lint/test_import_modules.py

index e55ac3e3144829a96ba2ebf6e96abdc057f6a69c..1d7e26f900bb914984b4a11d4023f40e5786ff06 100644 (file)
@@ -1,17 +1,19 @@
-# Copyright: 2009-2010 Gentoo Foundation
+# Copyright: 2009-2011 Gentoo Foundation
 # Author(s): Petteri R&#228;ty (betelgeuse@gentoo.org)
 # License: GPL2
 
 __all__ = ['database']
 
+import portage
 from portage.cache import fs_template
 from portage.versions import catsplit
 from portage import cpv_getkey
 from portage import os
 from portage import _encodings
 from portage import _unicode_decode
-import xattr
 from errno import ENODATA,ENOSPC,E2BIG
+portage.proxy.lazyimport.lazyimport(globals(),
+       'xattr')
 
 class NoValueException(Exception):
        pass
index c0551c7bea1ac6c8dbba04f3a00b3015a2b96455..87bb4bf0785f87d5e9b20302290d75532c147964 100644 (file)
@@ -11,7 +11,6 @@ class ImportModulesTestCase(TestCase):
 
        def testImportModules(self):
                expected_failures = frozenset((
-                       "portage.cache.ebuild_xattr",   #automagic dep on xattr
                ))
 
                for mod in self._list_modules(PORTAGE_PYM_PATH):