Mercurial > public > mercurial-scm > hg
diff mercurial/mdiff.py @ 50925: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 | e586a7eb380a |
children | 18c8c18993f0 |
line wrap: on
line diff
--- a/mercurial/mdiff.py Thu Dec 08 15:33:19 2022 +0100 +++ b/mercurial/mdiff.py Thu Aug 31 23:56:15 2023 +0200 @@ -211,11 +211,7 @@ def chooseblocksfunc(opts=None): - if ( - opts is None - or not opts.xdiff - or not util.safehasattr(bdiff, 'xdiffblocks') - ): + if opts is None or not opts.xdiff or not hasattr(bdiff, 'xdiffblocks'): return bdiff.blocks else: return bdiff.xdiffblocks