Skip to content

Commit a1f0b4b

Browse files
committed
Document with_rebuilt.ignoring
1 parent 1d75179 commit a1f0b4b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

julia/with_rebuilt.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ def maybe_rebuild(rebuild, julia):
5151

5252
@contextmanager
5353
def ignoring(sig):
54+
"""
55+
Context manager for ignoring signal `sig`.
56+
57+
For example,::
58+
59+
with ignoring(signal.SIGINT):
60+
do_something()
61+
62+
would ignore user's ctrl-c during ``do_something()``. This is
63+
useful when launching interactive program (in which ctrl-c is a
64+
valid keybinding) from Python.
65+
"""
5466
s = signal.signal(sig, signal.SIG_IGN)
5567
try:
5668
yield

0 commit comments

Comments
 (0)