# HG changeset patch # User Matt Harbison # Date 1701493092 18000 # Node ID 4ed9efb25bc7449b32398f2e772d5d872cab5fde # Parent de9cbc5a14505cc408eade49cc8f53134fc35afe phabricator: stringify the argument to `getattr()` This fixes a "TypeError: getattr(): attribute name must be string" crash and subsequent test spew. This likely broke in 18c8c18993f0 and was missed in CI because `pytest-vcr` is missing. diff -r de9cbc5a1450 -r 4ed9efb25bc7 hgext/phabricator.py --- a/hgext/phabricator.py Mon Nov 13 09:19:11 2023 -0800 +++ b/hgext/phabricator.py Fri Dec 01 23:58:12 2023 -0500 @@ -1926,7 +1926,9 @@ raise error.Abort(_(b'unknown symbol: %s') % tree[1]) elif op in {b'and_', b'add', b'sub'}: assert len(tree) == 3 - return getattr(operator, op)(walk(tree[1]), walk(tree[2])) + return getattr(operator, pycompat.sysstr(op))( + walk(tree[1]), walk(tree[2]) + ) elif op == b'group': return walk(tree[1]) elif op == b'ancestors':