Mercurial > hg-stable
changeset 30591:2d555d753f0e
py3: make keys of keyword arguments strings
keys of keyword arguments on Python 3 has to be string. We are dealing with
bytes in our codebase so the keys are also bytes. Done that using
pycompat.strkwargs().
Also after this patch, `hg version` now runs on Python 3.5. Hurray!
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 13 Dec 2016 20:53:40 +0530 |
parents | 0f865311ae3f |
children | b3643bfc7fcb |
files | mercurial/dispatch.py tests/test-check-py3-commands.t |
diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/dispatch.py Mon Dec 12 08:01:52 2016 +0000 +++ b/mercurial/dispatch.py Tue Dec 13 20:53:40 2016 +0530 @@ -803,7 +803,8 @@ msg = ' '.join(' ' in a and repr(a) or a for a in fullargs) ui.log("command", '%s\n', msg) - d = lambda: util.checksignature(func)(ui, *args, **cmdoptions) + strcmdopt = pycompat.strkwargs(cmdoptions) + d = lambda: util.checksignature(func)(ui, *args, **strcmdopt) try: return runcommand(lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions)
--- a/tests/test-check-py3-commands.t Mon Dec 12 08:01:52 2016 +0000 +++ b/tests/test-check-py3-commands.t Tue Dec 13 20:53:40 2016 +0530 @@ -9,6 +9,6 @@ > $PYTHON3 `which hg` $cmd 2>&1 2>&1 | tail -1 > done version - TypeError: Can't convert 'bytes' object to str implicitly + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. debuginstall TypeError: Can't convert 'bytes' object to str implicitly