__all__ = ['database']
+import errno
+
import portage
from portage.cache import fs_template
from portage.versions import catsplit
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')
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
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()