From 90c4c7a8167b15431b65f1b99e97b9c4dc16839e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 11 Oct 2013 06:24:22 -0400 Subject: [PATCH] xattr-helper: use ValueError when the input is wrong This is the standard exception for when the input is incorrect. --- bin/xattr-helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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): -- 2.26.2