From 291f4dc8bb41a69805036b9d5eeb3ba3690d1812 Mon Sep 17 00:00:00 2001 From: Junru Shao Date: Wed, 27 May 2020 13:50:56 -0700 Subject: [PATCH] [Bugfix] Fix Python debugger segfaults with TVM built with LLVM (#5685) * Import readline before loading libtvm * make lint happy --- python/tvm/_ffi/base.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/tvm/_ffi/base.py b/python/tvm/_ffi/base.py index 8674e31..2cca014 100644 --- a/python/tvm/_ffi/base.py +++ b/python/tvm/_ffi/base.py @@ -51,6 +51,11 @@ def _load_lib(): lib.TVMGetLastError.restype = ctypes.c_char_p return lib, os.path.basename(lib_path[0]) +try: + import readline # pylint: disable=unused-import +except ImportError: + pass + # version number __version__ = libinfo.__version__ # library instance -- 2.7.4