This is an archive of the discontinued Mercurial Phabricator instance.

py3: replace `unicode` with pycompat.unicode
ClosedPublic

Authored by pulkit on Jun 10 2018, 6:32 AM.

Details

Summary

unicode() is not available on Python 3 and throws a NameError because unicodes
are now default str() on py3.

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.

Event Timeline

pulkit created this revision.Jun 10 2018, 6:32 AM
yuja added a subscriber: yuja.Jun 10 2018, 11:01 AM
unicode() is not available on Python 3 and throws a NameError because unicodes
are now default str() on py3.

Appears that we need many type(u'')s, so I'd rather make pycompat.unicode
available on both Py2 and Py3. IMHO, type(u'') is just a temporary
workaround.

pulkit retitled this revision from py3: replace `unicode` with `type(u'')` in isinstance() calls to py3: replace `unicode` with pycompat.unicode.Jun 13 2018, 2:42 PM
pulkit updated this revision to Diff 9053.
This revision was automatically updated to reflect the committed changes.