From 62795c652c963de5fe28120bcf36d06bb3ac91ab Mon Sep 17 00:00:00 2001 From: Gunther Cox Date: Wed, 19 Sep 2018 16:39:28 -0400 Subject: [PATCH] Simplify custom exception class --- chatterbot/adapters.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/chatterbot/adapters.py b/chatterbot/adapters.py index 83ce94c70..464ad2b4c 100644 --- a/chatterbot/adapters.py +++ b/chatterbot/adapters.py @@ -28,16 +28,11 @@ class AdapterMethodNotImplementedError(NotImplementedError): method in a subclass. """ - def __init__(self, message=None): + def __init__(self, message='This method must be overridden in a subclass method.'): """ - Set the message for the esception. + Set the message for the exception. """ - if not message: - message = 'This method must be overridden in a subclass method.' - self.message = message - - def __str__(self): - return self.message + super().__init__(message) class InvalidAdapterTypeException(Exception): """