hgweb: move remaining hasattr calls to safehasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 15:38:46 -0500
changeset 14957 16e5271b216f
parent 14956 1b3f5f603aef
child 14958 fd246aefedd3
hgweb: move remaining hasattr calls to safehasattr
mercurial/hgweb/server.py
mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/server.py	Mon Jul 25 15:38:10 2011 -0500
+++ b/mercurial/hgweb/server.py	Mon Jul 25 15:38:46 2011 -0500
@@ -248,7 +248,7 @@
     from threading import activeCount
     _mixin = SocketServer.ThreadingMixIn
 except ImportError:
-    if hasattr(os, "fork"):
+    if util.safehasattr(os, "fork"):
         _mixin = SocketServer.ForkingMixIn
     else:
         class _mixin(object):
--- a/mercurial/hgweb/webutil.py	Mon Jul 25 15:38:10 2011 -0500
+++ b/mercurial/hgweb/webutil.py	Mon Jul 25 15:38:46 2011 -0500
@@ -72,7 +72,7 @@
         d['date'] = s.date()
         d['description'] = s.description()
         d['branch'] = s.branch()
-        if hasattr(s, 'path'):
+        if util.safehasattr(s, 'path'):
             d['file'] = s.path()
         yield d