From c54e39464cf8a426eedaca9183b7c5da5f7bad06 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 11 Sep 2020 14:33:06 -0700 Subject: [PATCH] check_file() assert unique --- utils/general.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/general.py b/utils/general.py index 2cbe517..eec8202 100755 --- a/utils/general.py +++ b/utils/general.py @@ -133,7 +133,8 @@ def check_file(file): else: files = glob.glob('./**/' + file, recursive=True) # find file 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):