changeset 14961:5523529bd1af

walkrepos: use getattr instead of hasattr for samestat
author Augie Fackler <durin42@gmail.com>
date Mon, 25 Jul 2011 15:45:11 -0500
parents 497819817307
children 1c917bc66ccc
files mercurial/scmutil.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Mon Jul 25 15:43:55 2011 -0500
+++ b/mercurial/scmutil.py	Mon Jul 25 15:45:11 2011 -0500
@@ -324,10 +324,10 @@
     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):