Factor out stripping of interpreter debug output in test.support.strip_python_stderr()
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index e6ba8cb..eb0f5d7 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -53,7 +53,7 @@
         # In a debug build, stuff like "[6580 refs]" is printed to stderr at
         # shutdown time.  That frustrates tests trying to check stderr produced
         # from a spawned Python process.
-        actual = re.sub("\[\d+ refs\]\r?\n?$", "", stderr.decode()).encode()
+        actual = support.strip_python_stderr(stderr)
         self.assertEqual(actual, expected, msg)