Commit c8fde0c
authored
Handle errors gracefully (#311)
I do not expect `sysctl -n hw.ncpu` to fail, but you never know.
Also use exclusive if because:
* function `os.sysconf` is available on Unix only:
https://docs.python.org/3/library/os.html#os.sysconf
* environment variable `NUMBER_OF_PROCESSORS` is set on Windows only1 parent f6869ab commit c8fde0c
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | | - | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
0 commit comments