patch: use safehasattr instead of hasattr
authorAugie Fackler <durin42@gmail.com>
Mon, 25 Jul 2011 16:02:27 -0500
changeset 14966 0588fb0e2e8d
parent 14965 194b043dfa51
child 14967 376091a4ad23
patch: use safehasattr instead of hasattr
mercurial/patch.py
--- a/mercurial/patch.py	Mon Jul 25 16:02:15 2011 -0500
+++ b/mercurial/patch.py	Mon Jul 25 16:02:27 2011 -0500
@@ -126,7 +126,7 @@
 
     mimeheaders = ['content-type']
 
-    if not hasattr(stream, 'next'):
+    if not util.safehasattr(stream, 'next'):
         # http responses, for example, have readline but not next
         stream = fiter(stream)