diff -r 194b043dfa51 -r 0588fb0e2e8d 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)