From 1aceacf89eca333174edf64cb14343d26b43c84d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Tue, 23 Jul 2019 14:07:00 +0100 Subject: [PATCH] [stream-refactor] replace old detach_popen() reference --- ansible_mitogen/affinity.py | 6 +++--- tests/ansible/tests/affinity_test.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ansible_mitogen/affinity.py b/ansible_mitogen/affinity.py index 09a6acee..94539e21 100644 --- a/ansible_mitogen/affinity.py +++ b/ansible_mitogen/affinity.py @@ -177,9 +177,9 @@ class FixedPolicy(Policy): 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 - process created with :func:`mitogen.parent.detach_popen`, ensuring - CPU-intensive children like SSH are not forced to share the same core as - the (otherwise potentially very busy) parent. + process created with :func:`mitogen.parent.popen`, ensuring CPU-intensive + children like SSH are not forced to share the same core as the (otherwise + potentially very busy) parent. """ def __init__(self, cpu_count=None): #: For tests. diff --git a/tests/ansible/tests/affinity_test.py b/tests/ansible/tests/affinity_test.py index 8ee96085..641455bd 100644 --- a/tests/ansible/tests/affinity_test.py +++ b/tests/ansible/tests/affinity_test.py @@ -199,10 +199,10 @@ class LinuxPolicyTest(testlib.TestCase): self.policy._set_cpu(3) my_cpu = self._get_cpus() - pid = mitogen.parent.detach_popen( + proc = mitogen.parent.popen( args=['cp', '/proc/self/status', tf.name] ) - os.waitpid(pid, 0) + proc.wait() his_cpu = self._get_cpus(tf.name) self.assertNotEquals(my_cpu, his_cpu)