1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-09 16:37:23 +01:00

Fixed EM101 (raw-string-in-exception): Exception must not use a string literal, assign to variable first

This commit is contained in:
Teal Dulcet
2023-12-22 07:10:48 -08:00
committed by Joshua Tauberer
parent 49124cc9ca
commit dd61844ced
7 changed files with 42 additions and 21 deletions

View File

@@ -507,7 +507,8 @@ def list_target_files(config):
path = ''
if bucket == "":
raise ValueError("Enter an S3 bucket name.")
msg = "Enter an S3 bucket name."
raise ValueError(msg)
# connect to the region & bucket
try:
@@ -535,7 +536,8 @@ def list_target_files(config):
b2_api.authorize_account("production", b2_application_keyid, b2_application_key)
bucket = b2_api.get_bucket_by_name(b2_bucket)
except NonExistentBucket as e:
raise ValueError("B2 Bucket does not exist. Please double check your information!")
msg = "B2 Bucket does not exist. Please double check your information!"
raise ValueError(msg)
return [(key.file_name, key.size) for key, _ in bucket.ls()]
else: