diff -r 046a7e828ea6 -r 10514a92860e mercurial/util.py --- a/mercurial/util.py Thu Nov 10 16:37:18 2016 -0500 +++ b/mercurial/util.py Mon Nov 14 23:32:54 2016 +0000 @@ -2190,6 +2190,11 @@ subsequent_indent=hangindent) return wrapper.fill(line).encode(encoding.encoding) +def iterfile(fp): + """like fp.__iter__ but does not have issues with EINTR. Python 2.7.12 is + known to have such issues.""" + return iter(fp.readline, '') + def iterlines(iterator): for chunk in iterator: for line in chunk.splitlines():