Mercurial > public > mercurial-scm > hg-stable
diff mercurial/smartset.py @ 50951: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 | f6cb926d4189 |
children | 18c8c18993f0 |
line wrap: on
line diff
--- a/mercurial/smartset.py Thu Dec 08 15:33:19 2022 +0100 +++ b/mercurial/smartset.py Thu Aug 31 23:56:15 2023 +0200 @@ -137,7 +137,7 @@ This is part of the mandatory API for smartset.""" # builtin cannot be cached. but do not needs to - if cache and util.safehasattr(condition, '__code__'): + if cache and hasattr(condition, '__code__'): condition = util.cachefunc(condition) return filteredset(self, condition, condrepr) @@ -1127,7 +1127,7 @@ This boldly assumes the other contains valid revs only. """ # other not a smartset, make is so - if not util.safehasattr(other, 'isascending'): + if not hasattr(other, 'isascending'): # filter out hidden revision # (this boldly assumes all smartset are pure) #