def debug(self, arguments: list = sys.argv[2:]): """Debug a single script""" parser = argparse.ArgumentParser(prog='ti debug', description=f"{self.debug.__doc__}") parser.add_argument( 'filename', help='A single (Python) script to run with debugger, e.g. render.py' ) args = parser.parse_args(arguments) # Short circuit for testing if self.test_mode: return args _ti_core.set_core_trigger_gdb_when_crash(True) os.environ['TI_DEBUG'] = '1' runpy.run_path(args.filename, run_name='__main__')
def set_gdb_trigger(on=True): _ti_core.set_core_trigger_gdb_when_crash(on)