Patchwork D3358: stringutil: teach pprint how to format None

login
register
mail settings
Submitter phabricator
Date April 16, 2018, 11:22 p.m.
Message ID <1a03821c97e2787d8de01ec8f8079c93@localhost.localdomain>
Download mbox | patch
Permalink /patch/31141/
State Not Applicable
Headers show

Comments

phabricator - April 16, 2018, 11:22 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG73d0a3dd7e53: stringutil: teach pprint how to format None (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3358?vs=8272&id=8352

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

AFFECTED FILES
  mercurial/utils/stringutil.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
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)