INNER CODE UNIT · Python
ignore_sigint
briscverse/ryp · ryp.py:24
class ignore_sigint:
"""
Ignore Ctrl + C when importing certain modules, to avoid errors due to
incomplete imports.
"""
def __enter__(self):
if threading.current_thread() is threading.main_thread():
signal.signal(signal.SIGINT, signal.SIG_IGN)
def __exit__(self, *_):
if threading.current_thread() is threading.main_thread():
signal.signal(signal.SIGINT, signal.default_int_handler)
def _get_rlib_path(R_home: str) -> str:
"""
Get the path to the R shared library.