Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia 1.0 support #183

Merged
merged 11 commits into from
Aug 22, 2018
Prev Previous commit
Next Next commit
Ignore SIGINT in with_rebuilt so that it works well with debuggers
tkf committed Aug 17, 2018
commit d6dd5db17e64dd34bbef5c2ea920b00c5255dd0f
12 changes: 11 additions & 1 deletion julia/with_rebuilt.py
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
from __future__ import print_function, absolute_import

import os
import signal
import subprocess
import sys
from contextlib import contextmanager
@@ -42,8 +43,17 @@ def maybe_rebuild(rebuild, julia):
yield


@contextmanager
def ignoring(sig):
s = signal.signal(sig, signal.SIG_IGN)
try:
yield
finally:
signal.signal(sig, s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a comment about what's going on here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a docstring.



def with_rebuilt(rebuild, julia, command):
with maybe_rebuild(rebuild, julia):
with maybe_rebuild(rebuild, julia), ignoring(signal.SIGINT):
print('Execute:', *command)
return subprocess.call(command)