Update openpype/lib/plugin_tools.py

improving exception behavior

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
Jakub Ježek 2021-11-16 14:45:00 +01:00 committed by GitHub
parent 7755a0cf74
commit ea76c1c346
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -537,14 +537,14 @@ def should_decompress(file_url):
"--info", "-v", file_url])
return "compression: \"dwaa\"" in output or \
"compression: \"dwab\"" in output
except RuntimeError as _E:
except RuntimeError:
_name, ext = os.path.splitext(file_url)
if ext in [".mxf"]:
# TODO: should't the list of allowed extensions be
# taken from an OIIO variable of supported formats
return False
else:
raise RuntimeError(_E)
# TODO: should't the list of allowed extensions be
# taken from an OIIO variable of supported formats
if ext not in [".mxf"]:
# Reraise exception
raise
return False
return False