From 54c86124529bf2c01a8f824b39438f816d7c81bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Fri, 6 Aug 2021 18:04:08 +0200 Subject: [PATCH] Remove unused code in `BasicConfig` (#1123) --- httpie/config.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/httpie/config.py b/httpie/config.py index d8c664a8..61f1accc 100644 --- a/httpie/config.py +++ b/httpie/config.py @@ -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 + self.path.write_text(json_string + '\n', encoding=UTF8) class Config(BaseConfigDict):