Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHGe3d595b7fbaa: pycompat: fix typos
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
pulkit |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/pycompat.py (4 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
01b5ac2b56fa | 14899d585e65 | Joerg Sonnenberger | Dec 27 2020, 7:40 PM |
opts, args = orig(args, shortlist, namelist) | opts, args = orig(args, shortlist, namelist) | ||||
opts = [(a[0].encode('latin-1'), a[1].encode('latin-1')) for a in opts] | opts = [(a[0].encode('latin-1'), a[1].encode('latin-1')) for a in opts] | ||||
args = [a.encode('latin-1') for a in args] | args = [a.encode('latin-1') for a in args] | ||||
return opts, args | return opts, args | ||||
def strkwargs(dic): | def strkwargs(dic): | ||||
""" | """ | ||||
Converts the keys of a python dictonary to str i.e. unicodes so that | Converts the keys of a python dictonary to str i.e. unicodes so that | ||||
they can be passed as keyword arguments as dictonaries with bytes keys | they can be passed as keyword arguments as dictionaries with bytes keys | ||||
can't be passed as keyword arguments to functions on Python 3. | can't be passed as keyword arguments to functions on Python 3. | ||||
""" | """ | ||||
dic = {k.decode('latin-1'): v for k, v in dic.items()} | dic = {k.decode('latin-1'): v for k, v in dic.items()} | ||||
return dic | return dic | ||||
def byteskwargs(dic): | def byteskwargs(dic): | ||||
""" | """ | ||||
Converts keys of python dictonaries to bytes as they were converted to | Converts keys of python dictionaries to bytes as they were converted to | ||||
str to pass that dictonary as a keyword argument on Python 3. | str to pass that dictonary as a keyword argument on Python 3. | ||||
""" | """ | ||||
dic = {k.encode('latin-1'): v for k, v in dic.items()} | dic = {k.encode('latin-1'): v for k, v in dic.items()} | ||||
return dic | return dic | ||||
# TODO: handle shlex.shlex(). | # TODO: handle shlex.shlex(). | ||||
def shlexsplit(s, comments=False, posix=True): | def shlexsplit(s, comments=False, posix=True): | ||||
""" | """ |