tests: Fix lingering Python 2 isms

pull/917/head
Alex Willmer 2 years ago
parent c9318a26f6
commit c87976af40

@ -5,6 +5,12 @@ Measure latency of .fork() setup/teardown.
import mitogen
import mitogen.core
try:
xrange
except NameError:
xrange = range
@mitogen.main()
def main(router):
t0 = mitogen.core.now()
@ -12,4 +18,4 @@ def main(router):
t = mitogen.core.now()
ctx = router.fork()
ctx.shutdown(wait=True)
print '++', 1000 * ((mitogen.core.now() - t0) / (1.0+x))
print('++ %d' % 1000 * ((mitogen.core.now() - t0) / (1.0+x)))

@ -79,7 +79,7 @@ def close_proc(proc):
proc.stdin.close()
proc.stdout.close()
if proc.stderr:
prco.stderr.close()
proc.stderr.close()
def wait_read(fp, n):

@ -25,7 +25,7 @@ def burn():
mul = 1.5
count = int(mul * multiprocessing.cpu_count())
print count
print(count)
procs = [multiprocessing.Process(target=burn)
for _ in range(count)]

Loading…
Cancel
Save