diff options
-rwxr-xr-x | xattr/tool.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xattr/tool.py b/xattr/tool.py index a7cfb47..89b9221 100755 --- a/xattr/tool.py +++ b/xattr/tool.py @@ -67,7 +67,14 @@ def usage(e=None): sys.exit(0) -_FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or '.' for x in range(256)]) +if sys.version_info < (3,): + ascii = repr + uchr = unichr +else: + uchr = chr + + +_FILTER = u''.join([(len(ascii(chr(x))) == 3) and uchr(x) or u'.' for x in range(256)]) def _dump(src, length=16): |