revlog: use getattr instead of hasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 15:43:55 -0500
changeset 14960 497819817307
parent 14959 b1dcc5ab86cd
child 14961 5523529bd1af
revlog: use getattr instead of hasattr
mercurial/revlog.py
--- a/mercurial/revlog.py	Mon Jul 25 15:41:46 2011 -0500
+++ b/mercurial/revlog.py	Mon Jul 25 15:43:55 2011 -0500
@@ -226,9 +226,10 @@
         self._nodepos = None
 
         v = REVLOG_DEFAULT_VERSION
-        if hasattr(opener, 'options'):
-            if 'revlogv1' in opener.options:
-                if 'generaldelta' in opener.options:
+        opts = getattr(opener, 'options', None)
+        if opts is not None:
+            if 'revlogv1' in opts:
+                if 'generaldelta' in opts:
                     v |= REVLOGGENERALDELTA
             else:
                 v = 0