Skip to content
Snippets Groups Projects
Commit 046b9cce authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

safehasattr: pass attribute name as string instead of bytes

This is a step toward replacing `util.safehasattr` usage with plain `hasattr`.
The builtin function behave poorly in Python2 but this was fixed in Python3.

These change are done one by one as they tend to have a small odd to trigger
puzzling breackage.
parent bf7ad17b
No related branches found
No related tags found
2 merge requests!618Draft: 6.5rc0,!555simple preliminary changes toward getting ride of "util.safehasattr"
......@@ -339,7 +339,7 @@
raise error.ProgrammingError(
b'Mercurial only does output with bytes: %r' % obj
)
elif util.safehasattr(obj, b'keys'):
elif util.safehasattr(obj, 'keys'):
out = [
b'"%s": %s'
% (encoding.jsonescape(k, paranoid=paranoid), json(v, paranoid))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment