cleanup: replace hasattr() usage with getattr() in hghave
authorBrodie Rao <brodie@sf.io>
Sat, 12 May 2012 16:00:53 +0200
changeset 16685 43d55088415a
parent 16684 e617876fe82d
child 16686 67964cda8701
cleanup: replace hasattr() usage with getattr() in hghave
tests/hghave
--- a/tests/hghave	Sat May 12 15:56:23 2012 +0200
+++ b/tests/hghave	Sat May 12 16:00:53 2012 +0200
@@ -106,7 +106,7 @@
         return False
 
 def has_fifo():
-    return hasattr(os, "mkfifo")
+    return getattr(os, "mkfifo", None) is not None
 
 def has_cacheable_fs():
     from mercurial import util
@@ -169,7 +169,7 @@
             matchoutput('p4d -V', r'Rev\. P4D/'))
 
 def has_symlink():
-    if not hasattr(os, "symlink"):
+    if getattr(os, "symlink", None) is None:
         return False
     name = tempfile.mktemp(dir=".", prefix='hg-checklink-')
     try: