Mercurial > public > mercurial-scm > hg-stable
diff mercurial/templater.py @ 14944:e2c413bde8a5
globally: use safehasattr(x, '__iter__') instead of hasattr(x, '__iter__')
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 25 Jul 2011 15:30:19 -0500 |
parents | d3bb825ddae3 |
children | 67964cda8701 |
line wrap: on
line diff
--- a/mercurial/templater.py Mon Jul 25 16:24:37 2011 -0500 +++ b/mercurial/templater.py Mon Jul 25 15:30:19 2011 -0500 @@ -203,14 +203,14 @@ '''yield a single stream from a possibly nested set of iterators''' if isinstance(thing, str): yield thing - elif not hasattr(thing, '__iter__'): + elif not util.safehasattr(thing, '__iter__'): if thing is not None: yield str(thing) else: for i in thing: if isinstance(i, str): yield i - elif not hasattr(i, '__iter__'): + elif not util.safehasattr(i, '__iter__'): if i is not None: yield str(i) elif i is not None: