summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-01-30 23:46:45 -0800
committerZac Medico <zmedico@gentoo.org>2011-01-30 23:46:45 -0800
commita074dc39f5bef8285035b739671fc32910fff733 (patch)
treec35e8a54bc17568edbe61009f3ef0a7c329a8a72
parent524630d15e9a8ab4cdba61a775dc15c4f70d88fb (diff)
downloadportage-a074dc39f5bef8285035b739671fc32910fff733.tar.gz
portage-a074dc39f5bef8285035b739671fc32910fff733.tar.bz2
portage-a074dc39f5bef8285035b739671fc32910fff733.zip
ebuild_xattr: lazily import xattr
-rw-r--r--pym/portage/cache/ebuild_xattr.py6
-rw-r--r--pym/portage/tests/lint/test_import_modules.py1
2 files changed, 4 insertions, 3 deletions
diff --git a/pym/portage/cache/ebuild_xattr.py b/pym/portage/cache/ebuild_xattr.py
index e55ac3e31..1d7e26f90 100644
--- a/pym/portage/cache/ebuild_xattr.py
+++ b/pym/portage/cache/ebuild_xattr.py
@@ -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
diff --git a/pym/portage/tests/lint/test_import_modules.py b/pym/portage/tests/lint/test_import_modules.py
index c0551c7be..87bb4bf07 100644
--- a/pym/portage/tests/lint/test_import_modules.py
+++ b/pym/portage/tests/lint/test_import_modules.py
@@ -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):