未验证 提交 1e515aa8 编写于 作者: S sneaxiy 提交者: GitHub

[Custom Ops]Assert _compile_dir/includes.txt existence (#39183)

* assert _compile_dir include file existence

* polish
上级 55164761
...@@ -449,8 +449,8 @@ def _get_include_dirs_when_compiling(compile_dir): ...@@ -449,8 +449,8 @@ def _get_include_dirs_when_compiling(compile_dir):
include_dirs_file = 'includes.txt' include_dirs_file = 'includes.txt'
path = os.path.abspath(compile_dir) path = os.path.abspath(compile_dir)
include_dirs_file = os.path.join(path, include_dirs_file) include_dirs_file = os.path.join(path, include_dirs_file)
if not os.path.isfile(include_dirs_file): assert os.path.isfile(include_dirs_file), "File {} does not exist".format(
return [] include_dirs_file)
with open(include_dirs_file, 'r') as f: with open(include_dirs_file, 'r') as f:
include_dirs = [line.strip() for line in f.readlines() if line.strip()] include_dirs = [line.strip() for line in f.readlines() if line.strip()]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册