Skip to content

Stop: a nan limit, the stop's own tasks and context, -0 and "--stop-limit -inf" (#81) - #82

Merged
Dyotson merged 2 commits into
mainfrom
fix/stop-follow-ups
Nov 23, 2026
Merged

Dyotson merged 2 commits into
mainfrom
fix/stop-follow-ups

Conversation

@Dyotson

@Dyotson Dyotson commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #81

Small follow-ups to the stop work in #80. A normal stop does not change.

  • If code sets the stop limit to nan, it now means "never break in", the same as 0. Before this, the watching thread spun at full speed. The command line already refuses nan.
  • The stop's own tasks from finish() are dropped from own_tasks once they are done.
  • The stop that run() starts after a break-in now runs in the same context as main(). Before, it ran in a copy of the thread's context.
  • --stop-limit -0 is refused like any other negative number. --stop-limit -inf given as two words now gets the usual "seconds from 0 (never) to 3600" message instead of argparse's "expected one argument".

Each point has a test that fails without its fix.

… after a break-in runs in main()'s context, -0 and "--stop-limit -inf" refused with the usual message (#81)

- watch: a limit of nan set by code ends the watching thread (Event.wait(nan) returned at
  once: it spun), as 0 does.
- finish: its stop task leaves own_tasks once done, and runs in the context main() runs in
  (run() passes it to the Runner and to finish), not a copy of the thread's.
- stop_limit refuses -0; glued() joins "--stop-limit -inf" (two words, argparse's "expected
  one argument") so the value gets stop_limit's message.
@Dyotson Dyotson self-assigned this Nov 23, 2026
@Dyotson
Dyotson marked this pull request as ready for review November 23, 2026 19:34
@Dyotson
Dyotson merged commit 6a9b521 into main Nov 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop: small follow-ups from the last check of #80

1 participant