[stream-refactor] replace old detach_popen() reference

pull/607/head
David Wilson 5 years ago
parent 300f8b2ff9
commit 1aceacf89e

@ -177,9 +177,9 @@ class FixedPolicy(Policy):
cores, before reusing the second hyperthread of an existing core. cores, before reusing the second hyperthread of an existing core.
A hook is installed that causes :meth:`reset` to run in the child of any A hook is installed that causes :meth:`reset` to run in the child of any
process created with :func:`mitogen.parent.detach_popen`, ensuring process created with :func:`mitogen.parent.popen`, ensuring CPU-intensive
CPU-intensive children like SSH are not forced to share the same core as children like SSH are not forced to share the same core as the (otherwise
the (otherwise potentially very busy) parent. potentially very busy) parent.
""" """
def __init__(self, cpu_count=None): def __init__(self, cpu_count=None):
#: For tests. #: For tests.

@ -199,10 +199,10 @@ class LinuxPolicyTest(testlib.TestCase):
self.policy._set_cpu(3) self.policy._set_cpu(3)
my_cpu = self._get_cpus() my_cpu = self._get_cpus()
pid = mitogen.parent.detach_popen( proc = mitogen.parent.popen(
args=['cp', '/proc/self/status', tf.name] args=['cp', '/proc/self/status', tf.name]
) )
os.waitpid(pid, 0) proc.wait()
his_cpu = self._get_cpus(tf.name) his_cpu = self._get_cpus(tf.name)
self.assertNotEquals(my_cpu, his_cpu) self.assertNotEquals(my_cpu, his_cpu)

Loading…
Cancel
Save