Mercurial > evolve
changeset 2751:4f560f117fff
compat: use 'safehasattr' over 'hasattr'
'hasattr' is broken in python 2.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 21 Jul 2017 09:50:26 +0200 |
parents | bd3824d1b795 |
children | 4457aa1d81aa |
files | hgext3rd/evolve/compat.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/compat.py Fri Jul 14 07:19:15 2017 +0530 +++ b/hgext3rd/evolve/compat.py Fri Jul 21 09:50:26 2017 +0200 @@ -8,7 +8,8 @@ from mercurial import ( hg, - obsolete + obsolete, + util, ) try: @@ -23,7 +24,7 @@ eh = exthelper.exthelper() -if not hasattr(hg, '_copycache'): +if not util.safehasattr(hg, '_copycache'): # exact copy of relevantmarkers as in Mercurial-176d1a0ce385 # this fixes relevant markers computation for version < hg-4.3 @eh.wrapfunction(obsolete.obsstore, 'relevantmarkers')