From: Mike Frysinger Date: Fri, 11 Oct 2013 10:24:22 +0000 (-0400) Subject: xattr-helper: use ValueError when the input is wrong X-Git-Tag: v2.2.8~61 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=90c4c7a8167b15431b65f1b99e97b9c4dc16839e;p=portage.git xattr-helper: use ValueError when the input is wrong This is the standard exception for when the input is incorrect. --- diff --git a/bin/xattr-helper.py b/bin/xattr-helper.py index 92bf1a28a..83ee32c81 100755 --- a/bin/xattr-helper.py +++ b/bin/xattr-helper.py @@ -135,13 +135,13 @@ def restore_xattrs(file_in): parts = line.split(b'=', 1) if len(parts) == 2: if pathname is None: - raise AssertionError('line %d: missing pathname' % (i + 1,)) + raise ValueError('line %d: missing pathname' % (i + 1,)) attr = unquote(parts[0]) - # strip trailing newline and quotes + # strip trailing newline and quotes value = unquote(parts[1].rstrip(b'\n')[1:-1]) xattr.set(pathname, attr, value) elif line.strip(): - raise AssertionError("line %d: malformed entry" % (i + 1,)) + raise ValueError('line %d: malformed entry' % (i + 1,)) def main(argv):