mail: use safehasattr instead of hasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 16:02:15 -0500
changeset 14965 194b043dfa51
parent 14964 376c32a5ccdc
child 14966 0588fb0e2e8d
mail: use safehasattr instead of hasattr
mercurial/mail.py
--- a/mercurial/mail.py	Mon Jul 25 15:55:51 2011 -0500
+++ b/mercurial/mail.py	Mon Jul 25 16:02:15 2011 -0500
@@ -37,7 +37,7 @@
     # backward compatible: when tls = true, we use starttls.
     starttls = tls == 'starttls' or util.parsebool(tls)
     smtps = tls == 'smtps'
-    if (starttls or smtps) and not hasattr(socket, 'ssl'):
+    if (starttls or smtps) and not util.safehasattr(socket, 'ssl'):
         raise util.Abort(_("can't use TLS: Python SSL support not installed"))
     if smtps:
         ui.note(_('(using smtps)\n'))