From: Mike Frysinger Date: Fri, 11 Oct 2013 10:19:49 +0000 (-0400) Subject: xattr-helper: use upper caps for module constants X-Git-Tag: v2.2.8~63 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=80036cd01dd468d6b5e583b890db90e20c09a585;p=portage.git xattr-helper: use upper caps for module constants --- diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py index a85309f4d..6d3301767 100755 --- a/bin/xattr-helper.py +++ b/bin/xattr-helper.py @@ -19,8 +19,10 @@ if hasattr(os, "getxattr"): else: import xattr -_unquote_re = re.compile(br'\\[0-7]{3}') -_fs_encoding = sys.getfilesystemencoding() + +_UNQUOTE_RE = re.compile(br'\\[0-7]{3}') +_FS_ENCODING = sys.getfilesystemencoding() + if sys.hexversion < 0x3000000: @@ -29,7 +31,7 @@ if sys.hexversion < 0x3000000: def unicode_encode(s): if isinstance(s, unicode): - s = s.encode(_fs_encoding) + s = s.encode(_FS_ENCODING) return s else: @@ -38,7 +40,7 @@ else: def unicode_encode(s): if isinstance(s, str): - s = s.encode(_fs_encoding) + s = s.encode(_FS_ENCODING) return s def quote(s, quote_chars): @@ -68,7 +70,7 @@ def unquote(s): s_len = len(s) while pos < s_len: - m = _unquote_re.search(s, pos=pos) + m = _UNQUOTE_RE.search(s, pos=pos) if m is None: result.append(s[pos:]) pos = s_len