Fixed UP015 (redundant-open-modes): Unnecessary open mode parameters

This commit is contained in:
Teal Dulcet
2024-03-10 07:54:49 -04:00
committed by Joshua Tauberer
parent 0ee64f2fe8
commit cb922ec286
9 changed files with 19 additions and 19 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ def load_env_vars_from_file(fn):
# Load settings from a KEY=VALUE file.
import collections
env = collections.OrderedDict()
with open(fn, 'r') as f:
with open(fn) as f:
for line in f:
env.setdefault(*line.strip().split("=", 1))
return env
@@ -36,7 +36,7 @@ def load_settings(env):
import rtyaml
fn = os.path.join(env['STORAGE_ROOT'], 'settings.yaml')
try:
with open(fn, "r") as f:
with open(fn) as f:
config = rtyaml.load(f)
if not isinstance(config, dict): raise ValueError() # caught below
return config