There are some places in codebase where we try to print the value None, however
'%s' % None is invalid on Python 3. So it will be good to have support in
stringutil.pprint()
Details
Details
- Reviewers
indygreg - Group Reviewers
hg-reviewers - Commits
- rHG7aeb8aa262eb: py3: add support for NoneType in stringutil.pprint()
Diff Detail
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
Comment Actions
- a/mercurial/utils/stringutil.py
+++ b/mercurial/utils/stringutil.py
@@ -29,6 +29,8 @@if bprefix: return "b'%s'" % escapestr(o) return "'%s'" % escapestr(o)+ elif o is None:
+ return 'None'
Should be handled by b'%r' % o.
Comment Actions
- a/mercurial/utils/stringutil.py
+++ b/mercurial/utils/stringutil.py
@@ -29,6 +29,8 @@if bprefix: return "b'%s'" % escapestr(o) return "'%s'" % escapestr(o)+ elif o is None:
+ return 'None'Should be handled by b'%r' % o.
Dropped this patch from hg-committed before sinking deep.