Commit 3a521f0
authored
Replace os.popen() with subprocess.check_output() in the platform module:
* platform.uname() (its _syscmd_ver() helper function) now redirects
stderr to DEVNULL.
* Remove platform.DEV_NULL.
* _syscmd_uname() and _syscmd_file() no longer catch AttributeError.
The "except AttributeError:" was only needed in Python 2, when
os.popen() was not always available. In Python 3,
subprocess.check_output() is always available.
1 parent 9ebe879 commit 3a521f0
3 files changed
Lines changed: 30 additions & 48 deletions
File tree
- Lib
- test
- Misc/NEWS.d/next/Library
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 122 | | |
136 | 123 | | |
137 | 124 | | |
| |||
288 | 275 | | |
289 | 276 | | |
290 | 277 | | |
| 278 | + | |
291 | 279 | | |
292 | 280 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
301 | 287 | | |
302 | 288 | | |
303 | 289 | | |
| |||
602 | 588 | | |
603 | 589 | | |
604 | 590 | | |
| 591 | + | |
| 592 | + | |
605 | 593 | | |
606 | | - | |
607 | | - | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
612 | 598 | | |
613 | | - | |
614 | | - | |
| 599 | + | |
615 | 600 | | |
616 | 601 | | |
617 | 602 | | |
| |||
629 | 614 | | |
630 | 615 | | |
631 | 616 | | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
636 | 621 | | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
| 622 | + | |
643 | 623 | | |
644 | 624 | | |
645 | 625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
232 | 231 | | |
233 | | - | |
234 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments