Commit bcdb0e2
authored
Fix timeout handling for zero-millisecond values
Previously, when `timeout_ms` was explicitly set to `0`, the condition `if args.timeout_ms` evaluated to `False` (since `0` is falsy), causing the timeout to be treated as `None` (no timeout).
This violated the intended behavior where `0` should mean "time out immediately."
The fix changes the check to `if args.timeout_ms is not None`, ensuring that:
- `timeout_ms=0` correctly results in a `0.0` second timeout
- `timeout_ms=None` (or unset) still results in no timeout
- All other positive values work as before
This aligns the implementation with standard `subprocess.run()` timeout semantics and prevents unintended indefinite command execution.1 parent cfddc7c commit bcdb0e2
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments