# HG changeset patch # User Yuya Nishihara # Date 1471503307 -32400 # Node ID 0d5cc0c18b4eddda13d78e5af8448f2975f09f2e # Parent cbf9984a7957622e79d1225f18fbe2373e669630 templater: make it clearer that _flatten() omits None diff -r cbf9984a7957 -r 0d5cc0c18b4e mercurial/templater.py --- a/mercurial/templater.py Thu Aug 18 17:25:10 2016 +0200 +++ b/mercurial/templater.py Thu Aug 18 15:55:07 2016 +0900 @@ -917,17 +917,19 @@ '''yield a single stream from a possibly nested set of iterators''' if isinstance(thing, str): yield thing + elif thing is None: + pass elif not util.safehasattr(thing, '__iter__'): - if thing is not None: - yield str(thing) + yield str(thing) else: for i in thing: if isinstance(i, str): yield i + elif i is None: + pass elif not util.safehasattr(i, '__iter__'): - if i is not None: - yield str(i) - elif i is not None: + yield str(i) + else: for j in _flatten(i): yield j