summaryrefslogtreecommitdiff
path: root/xattr/__init__.py
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2016-10-23 13:23:37 +0700
committerBob Ippolito <bob@redivi.com>2016-10-23 13:23:37 +0700
commitee147e3803def88aeca7986cbe51a36c9a386e36 (patch)
treec54755bcd3a280834cf9db2170775c701f872c85 /xattr/__init__.py
parent2746d7196331439030589c21aa7734888ecbe031 (diff)
downloadxattr-ee147e3803def88aeca7986cbe51a36c9a386e36.tar.gz
Fixes #51. Allow both int and long python types for fd
Diffstat (limited to 'xattr/__init__.py')
-rw-r--r--xattr/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/xattr/__init__.py b/xattr/__init__.py
index dad8e5a..57a771e 100644
--- a/xattr/__init__.py
+++ b/xattr/__init__.py
@@ -9,6 +9,7 @@ that exposes these extended attributes.
__version__ = '0.8.0'
+from .compat import integer_types
from .lib import (XATTR_NOFOLLOW, XATTR_CREATE, XATTR_REPLACE,
XATTR_NOSECURITY, XATTR_MAXNAMELEN, XATTR_FINDERINFO_NAME,
XATTR_RESOURCEFORK_NAME, _getxattr, _fgetxattr, _setxattr, _fsetxattr,
@@ -46,14 +47,14 @@ class xattr(object):
self.value = obj
def __repr__(self):
- if isinstance(self.value, int):
+ if isinstance(self.value, integer_types):
flavor = "fd"
else:
flavor = "file"
return "<%s %s=%r>" % (type(self).__name__, flavor, self.value)
def _call(self, name_func, fd_func, *args):
- if isinstance(self.value, int):
+ if isinstance(self.value, integer_types):
return fd_func(self.value, *args)
else:
return name_func(self.value, *args)