From f984cce52a465f7377f2d9188e728496a83821af Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Wed, 8 Sep 2021 15:06:31 +0200 Subject: [PATCH] Fix `check_suffix()` (#4712) Fix a bug when `file=''` --- utils/general.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/general.py b/utils/general.py index 06c62da..2033f76 100755 --- a/utils/general.py +++ b/utils/general.py @@ -244,7 +244,7 @@ def check_imshow(): def check_suffix(file='yolov5s.pt', suffix=('.pt',), msg=''): # Check file(s) for acceptable suffixes - if any(suffix): + if file and suffix: if isinstance(suffix, str): suffix = [suffix] for f in file if isinstance(file, (list, tuple)) else [file]: @@ -258,7 +258,7 @@ def check_yaml(file, suffix=('.yaml', '.yml')): def check_file(file, suffix=''): # Search/download file (if necessary) and return path - check_suffix(file, suffix) + check_suffix(file, suffix) # optional file = str(file) # convert to str() if Path(file).is_file() or file == '': # exists return file