Mercurial > hg
changeset 51147:4ed9efb25bc7 stable
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.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 01 Dec 2023 23:58:12 -0500 |
parents | de9cbc5a1450 |
children | 1dd01023649d |
files | hgext/phabricator.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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':