# HG changeset patch # User Augie Fackler # Date 2011-07-25 20:45:11 # Node ID 5523529bd1afe175d9072f3cd45abe4e3bee3b8b # Parent 4978198173073d5ca4445b6a1d5c839182a22e0f walkrepos: use getattr instead of hasattr for samestat diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -324,10 +324,10 @@ def walkrepos(path, followsym=False, see def errhandler(err): if err.filename == path: raise err - if followsym and hasattr(os.path, 'samestat'): + samestat = getattr(os.path, 'samestat', None) + if followsym and samestat is not None: def adddir(dirlst, dirname): match = False - samestat = os.path.samestat dirstat = os.stat(dirname) for lstdirstat in dirlst: if samestat(dirstat, lstdirstat):