diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-02-07 22:35:14 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-02-07 22:35:14 -0800 |
commit | ad382da72d24dbd0df1ee3696aacd638171a1cda (patch) | |
tree | faafabfd9a372992f3ab5d91205b28edf20282cc | |
parent | 15389929b684b41801ffc880c4a4e6714e4245b6 (diff) | |
download | portage-ad382da72d24dbd0df1ee3696aacd638171a1cda.tar.gz portage-ad382da72d24dbd0df1ee3696aacd638171a1cda.tar.bz2 portage-ad382da72d24dbd0df1ee3696aacd638171a1cda.zip |
cache.ebuild_xattr: don't import ENODATA globally
ENODATA is undefined on FreeBSD. This will fix bug #354057.
-rw-r--r-- | pym/portage/cache/ebuild_xattr.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pym/portage/cache/ebuild_xattr.py b/pym/portage/cache/ebuild_xattr.py index 1d7e26f90..6b388faaf 100644 --- a/pym/portage/cache/ebuild_xattr.py +++ b/pym/portage/cache/ebuild_xattr.py @@ -4,6 +4,8 @@ __all__ = ['database'] +import errno + import portage from portage.cache import fs_template from portage.versions import catsplit @@ -11,7 +13,6 @@ from portage import cpv_getkey from portage import os from portage import _encodings from portage import _unicode_decode -from errno import ENODATA,ENOSPC,E2BIG portage.proxy.lazyimport.lazyimport(globals(), 'xattr') @@ -58,16 +59,16 @@ class database(fs_template.FsBased): except IOError as e: # ext based give wrong errno # http://bugzilla.kernel.org/show_bug.cgi?id=12793 - if e.errno in (E2BIG,ENOSPC): + if e.errno in (errno.E2BIG, errno.ENOSPC): result = len(s)-100 else: - raise e + raise try: self.__remove(path,'test_max') except IOError as e: - if e.errno is not ENODATA: - raise e + if e.errno != errno.ENODATA: + raise return result @@ -87,7 +88,7 @@ class database(fs_template.FsBased): try: return xattr.get(path,key,namespace=self.ns) except IOError as e: - if not default is None and ENODATA == e.errno: + if not default is None and errno.ENODATA == e.errno: return default else: raise NoValueException() |