diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -917,17 +917,19 @@ def _flatten(thing): '''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