Fix parsing of different exception string formats (#4785)
authorjmorrill <jeremiah.morrill@gmail.com>
Thu, 30 Jan 2020 16:43:16 +0000 (08:43 -0800)
committerGitHub <noreply@github.com>
Thu, 30 Jan 2020 16:43:16 +0000 (00:43 +0800)
python/tvm/_ffi/base.py

index cdcc131..36effa3 100644 (file)
@@ -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