Patchwork D3358: stringutil: teach pprint how to format None

login
register
mail settings
Submitter phabricator
Date April 14, 2018, 4:32 a.m.
Message ID <differential-rev-PHID-DREV-etukghe4lp37jwjezq5f-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30982/
State Superseded
Headers show

Comments

phabricator - April 14, 2018, 4:32 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3358

AFFECTED FILES
  mercurial/utils/stringutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/utils/stringutil.py b/mercurial/utils/stringutil.py
--- a/mercurial/utils/stringutil.py
+++ b/mercurial/utils/stringutil.py
@@ -42,6 +42,8 @@ 
         return '%d' % o
     elif isinstance(o, float):
         return '%f' % o
+    elif o is None:
+        return b'None'
     else:
         raise error.ProgrammingError('do not know how to format %r' % o)