summaryrefslogtreecommitdiff
path: root/Lib/test/libregrtest/utils.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-23 19:03:52 +0200
committerGitHub <noreply@github.com>2020-04-23 19:03:52 +0200
commitd663d34685e18588748569468c672763f4c73b3e (patch)
tree9d5dacf672a50135ef10efef37e3b51f20aac1ad /Lib/test/libregrtest/utils.py
parent02e4484f19304a0a5f484f06a3fa441c6fb6073a (diff)
downloadcpython-git-d663d34685e18588748569468c672763f4c73b3e.tar.gz
bpo-39983: Add test.support.print_warning() (GH-19683)
Log "Warning -- ..." test warnings into sys.__stderr__ rather than sys.stderr, to ensure to display them even if sys.stderr is captured. test.libregrtest.utils.print_warning() now calls test.support.print_warning().
Diffstat (limited to 'Lib/test/libregrtest/utils.py')
-rw-r--r--Lib/test/libregrtest/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py
index 40faed832c..0368694b2a 100644
--- a/Lib/test/libregrtest/utils.py
+++ b/Lib/test/libregrtest/utils.py
@@ -62,7 +62,7 @@ def printlist(x, width=70, indent=4, file=None):
def print_warning(msg):
- print(f"Warning -- {msg}", file=sys.stderr, flush=True)
+ support.print_warning(msg)
orig_unraisablehook = None