Fix flake8 issues found in cli

This commit is contained in:
Micah Lee 2021-04-29 17:13:05 -07:00
parent 343e1be3d0
commit 0a6056e5e6
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
14 changed files with 146 additions and 128 deletions

View file

@ -22,12 +22,6 @@ import json
import os
import locale
try:
# We only need pwd module in macOS, and it's not available in Windows
import pwd
except:
pass
class Settings(object):
"""
@ -166,13 +160,13 @@ class Settings(object):
with open(self.filename, "r") as f:
self._settings = json.load(f)
self.fill_in_defaults()
except:
except Exception:
pass
# Make sure data_dir exists
try:
os.makedirs(self.get("data_dir"), exist_ok=True)
except:
except Exception:
pass
def save(self):
@ -191,7 +185,7 @@ class Settings(object):
if key == "control_port_port" or key == "socks_port":
try:
val = int(val)
except:
except Exception:
if key == "control_port_port":
val = self.default_settings["control_port_port"]
elif key == "socks_port":