From 22257644384ba72b88e0b3dd0629c6bde8313c8e Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 3 Nov 2020 19:31:04 +0200 Subject: [PATCH] tests: set subprocess._active to None (#4818) To better reflect https://github.com/python/cpython/pull/14360 --- tests/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 2b28b65af..2f0b52793 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -29,11 +29,15 @@ if os.name == "nt": # exception, which it doesn't ignore and so Popen is not able to cleanup # old processes and that prevents it from creating any new processes at # all, which results in our tests failing whenever they try to use Popen. + # This patch was released in 3.9.0 and backported to some earlier + # versions. + if sys.version_info < (3, 9, 0): - def noop(): - pass + def noop(): + pass - subprocess._cleanup = noop + subprocess._cleanup = noop + subprocess._active = None else: import resource