Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b2bd3b

Browse files
committed
Have script_helper._assert_python strip refcount strings from stderr.
This makes the output of the function and those that depend on it independent of whether or not they are being run under a debug build.
1 parent 53a9dd7 commit 1b2bd3b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/script_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import sys
55
import os
6+
import re
67
import os.path
78
import tempfile
89
import subprocess
@@ -12,7 +13,7 @@
1213
import zipfile
1314

1415
from imp import source_from_cache
15-
from test.support import make_legacy_pyc
16+
from test.support import make_legacy_pyc, strip_python_stderr
1617

1718
# Executing the interpreter in a subprocess
1819
def _assert_python(expected_success, *args, **env_vars):
@@ -34,6 +35,7 @@ def _assert_python(expected_success, *args, **env_vars):
3435
p.stdout.close()
3536
p.stderr.close()
3637
rc = p.returncode
38+
err = strip_python_stderr(err)
3739
if (rc and expected_success) or (not rc and not expected_success):
3840
raise AssertionError(
3941
"Process return code is %d, "

0 commit comments

Comments
 (0)