From 836cefe45633331d0e5692295174bf3181a5e365 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Thu, 6 Aug 2020 09:47:35 -0500 Subject: Change MissingKeyErrors to KeyError --- config_file/abstract_parser.py | 4 ++-- config_file/base_parser.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'config_file') diff --git a/config_file/abstract_parser.py b/config_file/abstract_parser.py index ab5d205..689fece 100644 --- a/config_file/abstract_parser.py +++ b/config_file/abstract_parser.py @@ -57,7 +57,7 @@ class AbstractParser(ABC): Whatever value the given key happens to contain. Raises: - MissingKeyError: If the key to retrieve does not exist. + KeyError: If the key to retrieve does not exist. """ raise NotImplementedError @@ -81,7 +81,7 @@ class AbstractParser(ABC): key: The key we would like to remove. Raises: - MissingKeyError: If the key to remove does not exist. + KeyError: If the key to remove does not exist. """ raise NotImplementedError diff --git a/config_file/base_parser.py b/config_file/base_parser.py index a987a55..a440dcb 100644 --- a/config_file/base_parser.py +++ b/config_file/base_parser.py @@ -2,7 +2,7 @@ from types import ModuleType from typing import Any, Type from config_file.abstract_parser import AbstractParser -from config_file.exceptions import MissingKeyError, ParsingError +from config_file.exceptions import ParsingError from config_file.nested_lookup import get_occurrence_of_key from config_file.utils import split_on_dot @@ -123,7 +123,7 @@ class BaseParser(AbstractParser): content_reference = content_reference[key] except (KeyError, TypeError): - raise MissingKeyError(f"The specified key '{key}' to delete was not found.") + raise KeyError(f"The specified key '{key}' to delete was not found.") def stringify(self) -> str: return self.__module.dumps(self.parsed_content) -- cgit v1.2.3