1
0
mirror of https://github.com/httpie/cli.git synced 2024-11-24 08:22:22 +02:00

Remove unused code in BasicConfig (#1123)

This commit is contained in:
Mickaël Schoentgen 2021-08-06 18:04:08 +02:00 committed by GitHub
parent 4ff22defe4
commit 54c8612452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ class BaseConfigDict(dict):
except OSError as e:
raise ConfigFileError(f'cannot read {config_type} file: {e}')
def save(self, fail_silently=False):
def save(self):
self['__meta__'] = {
'httpie': __version__
}
@ -111,18 +111,7 @@ class BaseConfigDict(dict):
sort_keys=True,
ensure_ascii=True,
)
try:
self.path.write_text(json_string + '\n', encoding=UTF8)
except OSError:
if not fail_silently:
raise
def delete(self):
try:
# TODO: use `missing_ok` kwarg when supporting Python 3.8+ only
self.path.unlink()
except FileNotFoundError:
pass
class Config(BaseConfigDict):