mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-06 16:07:22 +01:00
Fixed RSE102 (unnecessary-paren-on-raise-exception): Unnecessary parentheses on raised exception
This commit is contained in:
committed by
Joshua Tauberer
parent
13b38cc04d
commit
51dc7615f7
@@ -581,7 +581,7 @@ def get_backup_config(env, for_save=False, for_ui=False):
|
||||
try:
|
||||
with open(os.path.join(backup_root, 'custom.yaml')) as f:
|
||||
custom_config = rtyaml.load(f)
|
||||
if not isinstance(custom_config, dict): raise ValueError() # caught below
|
||||
if not isinstance(custom_config, dict): raise ValueError # caught below
|
||||
config.update(custom_config)
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -817,7 +817,7 @@ def get_custom_dns_config(env, only_real_records=False):
|
||||
try:
|
||||
with open(os.path.join(env['STORAGE_ROOT'], 'dns/custom.yaml')) as f:
|
||||
custom_dns = rtyaml.load(f)
|
||||
if not isinstance(custom_dns, dict): raise ValueError() # caught below
|
||||
if not isinstance(custom_dns, dict): raise ValueError # caught below
|
||||
except:
|
||||
return [ ]
|
||||
|
||||
@@ -835,7 +835,7 @@ def get_custom_dns_config(env, only_real_records=False):
|
||||
|
||||
# No other type of data is allowed.
|
||||
else:
|
||||
raise ValueError()
|
||||
raise ValueError
|
||||
|
||||
for rtype, value2 in values:
|
||||
if isinstance(value2, str):
|
||||
@@ -845,7 +845,7 @@ def get_custom_dns_config(env, only_real_records=False):
|
||||
yield (qname, rtype, value3)
|
||||
# No other type of data is allowed.
|
||||
else:
|
||||
raise ValueError()
|
||||
raise ValueError
|
||||
|
||||
def filter_custom_records(domain, custom_dns_iter):
|
||||
for qname, rtype, value in custom_dns_iter:
|
||||
|
||||
@@ -38,7 +38,7 @@ def load_settings(env):
|
||||
try:
|
||||
with open(fn) as f:
|
||||
config = rtyaml.load(f)
|
||||
if not isinstance(config, dict): raise ValueError() # caught below
|
||||
if not isinstance(config, dict): raise ValueError # caught below
|
||||
return config
|
||||
except:
|
||||
return { }
|
||||
|
||||
Reference in New Issue
Block a user