walkrepos: use getattr instead of hasattr for samestat
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 15:45:11 -0500
changeset 14961 5523529bd1af
parent 14960 497819817307
child 14962 1c917bc66ccc
walkrepos: use getattr instead of hasattr for samestat
mercurial/scmutil.py
--- 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):