Unverified 提交 c54e3946 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

check_file() assert unique

上级 720645d9
...@@ -133,7 +133,8 @@ def check_file(file): ...@@ -133,7 +133,8 @@ def check_file(file):
else: else:
files = glob.glob('./**/' + file, recursive=True) # find file files = glob.glob('./**/' + file, recursive=True) # find file
assert len(files), 'File Not Found: %s' % file # assert file was found assert len(files), 'File Not Found: %s' % file # assert file was found
return files[0] # return first file if multiple found assert len(files) == 1, "Multiple files match '%s', specify exact path: %s" % (file, files) # assert unique
return files[0] # return file
def check_dataset(dict): def check_dataset(dict):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论