##// END OF EJS Templates
worker: migrate to util.iterfile
Jun Wu -
r30396:78a58dcf default
parent child Browse files
Show More
@@ -14,7 +14,10 b' import sys'
14 import threading
14 import threading
15
15
16 from .i18n import _
16 from .i18n import _
17 from . import error
17 from . import (
18 error,
19 util,
20 )
18
21
19 def countcpus():
22 def countcpus():
20 '''try to count the number of CPUs on the system'''
23 '''try to count the number of CPUs on the system'''
@@ -128,7 +131,7 b' def _posixworker(ui, func, staticargs, a'
128 os.kill(os.getpid(), -status)
131 os.kill(os.getpid(), -status)
129 sys.exit(status)
132 sys.exit(status)
130 try:
133 try:
131 for line in fp:
134 for line in util.iterfile(fp):
132 l = line.split(' ', 1)
135 l = line.split(' ', 1)
133 yield int(l[0]), l[1][:-1]
136 yield int(l[0]), l[1][:-1]
134 except: # re-raises
137 except: # re-raises
General Comments 0
You need to be logged in to leave comments. Login now