From 7342184435ed1f8d8e67849875d1a956a614ff00 Mon Sep 17 00:00:00 2001 From: shafi456 Date: Fri, 31 Jan 2025 15:24:21 +0600 Subject: [PATCH] Replaced ASSERT statements with if statements raising valueERROR #574 --- src/extractcode/uncompress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extractcode/uncompress.py b/src/extractcode/uncompress.py index 143e336..5d3722b 100644 --- a/src/extractcode/uncompress.py +++ b/src/extractcode/uncompress.py @@ -58,8 +58,8 @@ def uncompress_file(location, decompressor): # FIXME: do not create a sub-directory and instead strip the "compression" # extension such gz, etc. or introspect the archive header to get the file # name when present. - assert location - assert decompressor + if not location: raise ValueError("Invalid file location: Location cannot be none or empty.") + if not decompressor: raise ValueError("Invalid decompressor: Decompressor object cannot be none or empty.") warnings = [] base_name = fileutils.file_base_name(location)