changeset 14960:497819817307

revlog: use getattr instead of hasattr
author Augie Fackler <durin42@gmail.com>
date Mon, 25 Jul 2011 15:43:55 -0500
parents b1dcc5ab86cd
children 5523529bd1af
files mercurial/revlog.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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