Mercurial > hg
diff mercurial/repoview.py @ 50928:d718eddf01d9
safehasattr: drop usage in favor of hasattr
The two functions should now be equivalent at least in their usage in core.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 31 Aug 2023 23:56:15 +0200 |
parents | 1680ef94ad2b |
children | 18c8c18993f0 |
line wrap: on
line diff
--- a/mercurial/repoview.py Thu Dec 08 15:33:19 2022 +0100 +++ b/mercurial/repoview.py Thu Aug 31 23:56:15 2023 +0200 @@ -296,13 +296,12 @@ This returns a version of 'revs' to be used thereafter by the caller. In particular, if revs is an iterator, it is converted into a set. """ - safehasattr = util.safehasattr - if safehasattr(revs, '__next__'): + if hasattr(revs, '__next__'): # Note that inspect.isgenerator() is not true for iterators, revs = set(revs) filteredrevs = self.filteredrevs - if safehasattr(revs, 'first'): # smartset + if hasattr(revs, 'first'): # smartset offenders = revs & filteredrevs else: offenders = filteredrevs.intersection(revs)