Skip to content

Commit 4ccecad

Browse files
committed
Only add -W error if the user didn't specify a warnings policy
1 parent 1fd81f9 commit 4ccecad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/test/libregrtest/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,12 @@ def _add_ci_python_opts(self, python_opts, keep_environ):
657657
if not sys.stdout.write_through and sys.platform != "android":
658658
python_opts.append('-u')
659659

660-
# Add warnings filter 'error'
661-
if 'error' not in sys.warnoptions:
660+
# Add warnings filter 'error', unless the user specified a different
661+
# filter. Ignore BytesWarning since it's controlled by '-b' below.
662+
if not [
663+
opt for opt in sys.warnoptions
664+
if not opt.endswith("::BytesWarning")
665+
]:
662666
python_opts.extend(('-W', 'error'))
663667

664668
# Error on bytes/str comparison

0 commit comments

Comments
 (0)