| Conditions | 1 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | #!/usr/bin/env/python |
||
| 12 | def open_close(reaper, sleep, kill_after): |
||
| 13 | # Register this process |
||
| 14 | reaper.register(timeout=kill_after) |
||
| 15 | |||
| 16 | # Run a long-running operation |
||
| 17 | print("Will sleep for %s seconds." % sleep) |
||
| 18 | time.sleep(sleep) |
||
| 19 | |||
| 20 | # Unregister unless already killed by the GrimReaper |
||
| 21 | reaper.unregister() |
||
| 22 | |||
| 43 |