py3: use pycompat.byteskwargs on opts in phabricator.py
ClosedPublic

Authored by Kwan on Mar 8 2019, 10:01 PM.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Kwan created this revision.Mar 8 2019, 10:01 PM
yuja added a subscriber: yuja.Mar 9 2019, 8:29 PM

pycompat.byteskwargs() can be used instead.

Kwan added a comment.Mar 14 2019, 11:40 AM
In D6107#88990, @yuja wrote:

pycompat.byteskwargs() can be used instead.

I was under the impression that that was more of a hack, mainly useful for when there are lots of existing opts.get(b'') uses in a file, and when there are a few it was better to change to r''. Is it preferred to always use that then?

yuja added a comment.Mar 15 2019, 10:44 PM
I was under the impression that that was more of a hack, mainly useful for when there are lots of existing `opts.get(b'')` uses in a file, and when there are a few it was better to change to `r''`.

Correct. And I feel there are lots of s/b''/r''/s in this patch.

Kwan updated this revision to Diff 14522.Mar 16 2019, 7:52 AM
Kwan retitled this revision from py3: use r'' instead of b'' in opts.get() in phabricator.py to py3: use pycompat.byteskwargs on opts in phabricator.py.

Switch to using pycompat.byteskwargs.

This revision was automatically updated to reflect the committed changes.