summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/cache/ebuild_xattr.py13
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()