def traceback_writer_hook(file_suffix=""):
def write_to_file(exc_type, exc, tb):
sys.__excepthook__(exc_type, exc, tb)
fn = "yt_traceback%s" % file_suffix
with open(fn, "w") as fhandle:
traceback.print_exception(exc_type, exc, tb, file=fhandle)
print("Wrote traceback to %s" % fn)
MPI.COMM_WORLD.Abort(1)
return write_to_file
评论列表
文章目录