Skip for loop when config.ctc.root is not set in _ctc_find_lib

上级 17627651
...@@ -16,13 +16,14 @@ def _ctc_find_lib(): ...@@ -16,13 +16,14 @@ def _ctc_find_lib():
""" """
Find the directory that contains libwarpctc.so Find the directory that contains libwarpctc.so
""" """
lib_found = False if config.ctc.root != '':
for lib_dir in ["build", "lib", "lib64"]: lib_found = False
lib_path = os.path.join(config.ctc.root, lib_dir) for lib_dir in ["build", "lib", "lib64"]:
if os.path.isdir(lib_path) and os.path.exists(lib_path): lib_path = os.path.join(config.ctc.root, lib_dir)
lib_found = os.path.exists(os.path.join(lib_path, "libwarpctc.so")) if os.path.isdir(lib_path) and os.path.exists(lib_path):
if lib_found: lib_found = os.path.exists(os.path.join(lib_path, "libwarpctc.so"))
return lib_path if lib_found:
return lib_path
return None return None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论