Debug

Debug.auto_exclude_all_new_threads(func)[source]
Debug.dumpAllThreadTracebacks(exclude_thread_ids=set([]))[source]
Debug.setupWarnWithTraceback()[source]
Debug.initBetterExchook()[source]
Debug.format_signum(signum)[source]
Parameters:signum (int) –
Returns:string “signum (signame)”
Return type:str
Debug.signal_handler(signum, frame)[source]

Prints a message on stdout and dump all thread stacks.

Parameters:
  • signum (int) – e.g. signal.SIGUSR1
  • frame – ignored, will dump all threads
Debug.install_signal_handler_if_default(signum, exceptions_are_fatal=False)[source]
Parameters:
  • signum (int) – e.g. signal.SIGUSR1
  • exceptions_are_fatal (bool) – if True, will reraise any exceptions. if False, will just print a message
Returns:

True iff no exception, False otherwise. not necessarily that we registered our own handler

Return type:

bool

Debug.installNativeSignalHandler()[source]
Debug.installLibSigSegfault()[source]
Debug.initFaulthandler(sigusr1_chain=False)[source]

Maybe installs signal handlers, SIGUSR1 and SIGUSR2 and others. If no signals handlers are installed yet for SIGUSR1/2, we try to install our own Python handler. This also tries to install the handler from the fauldhandler module, esp for SIGSEGV and others.

Parameters:sigusr1_chain (bool) – whether the default SIGUSR1 handler should also be called.
Debug.initIPythonKernel(*args, **kwargs)[source]
Debug.initCudaNotInMainProcCheck()[source]
Debug.debug_shell(user_ns=None, user_global_ns=None, exit_afterwards=True)[source]