comparison hgext/phabricator.py @ 51144: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 18c8c18993f0
children 587153c96fe3
comparison
equal deleted inserted replaced
51143:de9cbc5a1450 51144:4ed9efb25bc7
1924 return smartset.baseset(drevs) 1924 return smartset.baseset(drevs)
1925 else: 1925 else:
1926 raise error.Abort(_(b'unknown symbol: %s') % tree[1]) 1926 raise error.Abort(_(b'unknown symbol: %s') % tree[1])
1927 elif op in {b'and_', b'add', b'sub'}: 1927 elif op in {b'and_', b'add', b'sub'}:
1928 assert len(tree) == 3 1928 assert len(tree) == 3
1929 return getattr(operator, op)(walk(tree[1]), walk(tree[2])) 1929 return getattr(operator, pycompat.sysstr(op))(
1930 walk(tree[1]), walk(tree[2])
1931 )
1930 elif op == b'group': 1932 elif op == b'group':
1931 return walk(tree[1]) 1933 return walk(tree[1])
1932 elif op == b'ancestors': 1934 elif op == b'ancestors':
1933 return getstack(walk(tree[1])) 1935 return getstack(walk(tree[1]))
1934 else: 1936 else: