Commit 2f8edb8
committed
Fix warn mode to work when warnings are configured as errors
Previous approach of clearing sys.warnoptions broke when CI used -bb
flag, because _args_from_interpreter_flags() expects certain warning
options to exist based on sys.flags settings.
Instead of clearing completely, filter out only the specific warning
options that would convert ImportWarning to errors:
- 'error' (converts all warnings)
- 'error::ImportWarning' (converts ImportWarning specifically)
This preserves options like 'error::BytesWarning' that subprocess's
_args_from_interpreter_flags() needs to remove, preventing ValueError.1 parent 9d8125f commit 2f8edb8
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
16 | 24 | | |
17 | 25 | | |
18 | 26 | | |
| |||
0 commit comments