[Bugfix] Fix Python debugger segfaults with TVM built with LLVM (#5685)
authorJunru Shao <junrushao1994@gmail.com>
Wed, 27 May 2020 20:50:56 +0000 (13:50 -0700)
committerGitHub <noreply@github.com>
Wed, 27 May 2020 20:50:56 +0000 (13:50 -0700)
* Import readline before loading libtvm

* make lint happy

python/tvm/_ffi/base.py

index 8674e31..2cca014 100644 (file)
@@ -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