changeset 30396:78a58dcf8853

worker: migrate to util.iterfile
author Jun Wu <quark@fb.com>
date Mon, 14 Nov 2016 23:12:11 +0000
parents 10514a92860e
children 564b33acc21f
files mercurial/worker.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/worker.py	Mon Nov 14 23:32:54 2016 +0000
+++ b/mercurial/worker.py	Mon Nov 14 23:12:11 2016 +0000
@@ -14,7 +14,10 @@
 import threading
 
 from .i18n import _
-from . import error
+from . import (
+    error,
+    util,
+)
 
 def countcpus():
     '''try to count the number of CPUs on the system'''
@@ -128,7 +131,7 @@
                 os.kill(os.getpid(), -status)
             sys.exit(status)
     try:
-        for line in fp:
+        for line in util.iterfile(fp):
             l = line.split(' ', 1)
             yield int(l[0]), l[1][:-1]
     except: # re-raises