Commit 4ff6290
committed
gh-000: Add missing stacklevel to warnings.warn() in subprocess.Popen
Both warnings.warn() calls in Popen.__init__ (one on POSIX for
pass_fds overriding close_fds, one on Windows for handle_list
overriding close_fds) were missing stacklevel=2.
Without stacklevel=2, the warning points to an internal line in
subprocess.py rather than the caller's Popen() invocation, making
it harder for users to locate the source of the warning in their
own code.1 parent ba1e1c1 commit 4ff6290
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
| 915 | + | |
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
| |||
1567 | 1567 | | |
1568 | 1568 | | |
1569 | 1569 | | |
1570 | | - | |
| 1570 | + | |
| 1571 | + | |
1571 | 1572 | | |
1572 | 1573 | | |
1573 | 1574 | | |
| |||
0 commit comments