From df9b829346fba5d62680d1df02e8a7e881209f06 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 18 Feb 2020 00:06:26 -0800 Subject: [PATCH] Replace some % formatters with fstrings. --- voussoirkit/spinal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/voussoirkit/spinal.py b/voussoirkit/spinal.py index 9f077b1..04519ab 100644 --- a/voussoirkit/spinal.py +++ b/voussoirkit/spinal.py @@ -549,7 +549,7 @@ def verify_hash(path, known_size, known_hash, callback=None): log.debug('Validating hash for "%s" against %s', path.absolute_path, known_hash) file_size = os.path.getsize(path.absolute_path) if file_size != known_size: - raise ValidationError('File size %d != known size %d' % (file_size, known_size)) + raise ValidationError(f'File size {file_size} != known size {known_size}.') handle = open(path.absolute_path, 'rb') hasher = HASH_CLASS() checked_bytes = 0 @@ -565,7 +565,7 @@ def verify_hash(path, known_size, known_hash, callback=None): file_hash = hasher.hexdigest() if file_hash != known_hash: - raise ValidationError('File hash "%s" != known hash "%s"' % (file_hash, known_hash)) + raise ValidationError(f'File hash "{file_hash}" != known hash "{known_hash}".') log.debug('Hash validation passed.')