Use NotImplementedError for better exception messages

NotImplemented would cause a TypeError
This commit is contained in:
Robin Neatherway
2017-06-23 18:10:41 +01:00
parent 4fb02e6900
commit 63d68df1d1
2 changed files with 3 additions and 3 deletions

View File

@@ -209,7 +209,7 @@ class ImageConverter(BaseImageConverter):
def is_available(self):
# type: () -> bool
"""Confirms the converter is available or not."""
raise NotImplemented
raise NotImplementedError()
def guess_mimetypes(self, node):
# type: (nodes.Node) -> List[unicode]
@@ -248,7 +248,7 @@ class ImageConverter(BaseImageConverter):
def convert(self, _from, _to):
# type: (unicode, unicode) -> bool
"""Converts the image to expected one."""
raise NotImplemented
raise NotImplementedError()
def setup(app):

View File

@@ -21,7 +21,7 @@ except ImportError:
class BaseStemmer(object):
def stem(self, word):
# type: (unicode) -> unicode
raise NotImplemented
raise NotImplementedError()
class PyStemmer(BaseStemmer):