From c8e7fa11420c817683e244d58e540052e331167a Mon Sep 17 00:00:00 2001 From: jmorrill Date: Thu, 30 Jan 2020 08:43:16 -0800 Subject: [PATCH] Fix parsing of different exception string formats (#4785) --- python/tvm/_ffi/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/tvm/_ffi/base.py b/python/tvm/_ffi/base.py index cdcc131ca257..36effa3800a8 100644 --- a/python/tvm/_ffi/base.py +++ b/python/tvm/_ffi/base.py @@ -205,8 +205,9 @@ def _find_error_type(line): return None start_pos = line.rfind(":", 0, end_pos) if start_pos == -1: - return None - err_name = line[start_pos + 1 : end_pos].strip() + err_name = line[:end_pos].strip() + else: + err_name = line[start_pos + 1 : end_pos].strip() if _valid_error_name(err_name): return err_name return None