diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-02-08 14:31:59 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-02-08 18:38:42 +0900 |
commit | 6fa0262802a09050e09445c9fd630c69b5ad1204 (patch) | |
tree | a2ad8f7849540d1b027e0b99d9913394b23c58d8 /sphinx/errors.py | |
parent | 81eb101e9f8fcee1c439ee0dd501d135eced01c6 (diff) | |
download | sphinx-git-6fa0262802a09050e09445c9fd630c69b5ad1204.tar.gz |
Fix mypy violations
Diffstat (limited to 'sphinx/errors.py')
-rw-r--r-- | sphinx/errors.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sphinx/errors.py b/sphinx/errors.py index 01f29d7aa..837bd5cff 100644 --- a/sphinx/errors.py +++ b/sphinx/errors.py @@ -10,6 +10,10 @@ :license: BSD, see LICENSE for details. """ +if False: + # For type annotation + from typing import Any # NOQA + class SphinxError(Exception): """ @@ -29,16 +33,19 @@ class ExtensionError(SphinxError): category = 'Extension error' def __init__(self, message, orig_exc=None): + # type: (unicode, Exception) -> None SphinxError.__init__(self, message) self.orig_exc = orig_exc def __repr__(self): + # type: () -> str if self.orig_exc: return '%s(%r, %r)' % (self.__class__.__name__, self.message, self.orig_exc) return '%s(%r)' % (self.__class__.__name__, self.message) def __str__(self): + # type: () -> str parent_str = SphinxError.__str__(self) if self.orig_exc: return '%s (exception: %s)' % (parent_str, self.orig_exc) @@ -59,6 +66,7 @@ class VersionRequirementError(SphinxError): class PycodeError(Exception): def __str__(self): + # type: () -> str res = self.args[0] if len(self.args) > 1: res += ' (exception was: %r)' % self.args[1] @@ -70,8 +78,10 @@ class SphinxParallelError(SphinxError): category = 'Sphinx parallel build error' def __init__(self, message, traceback): + # type: (str, Any) -> None self.message = message self.traceback = traceback def __str__(self): + # type: () -> str return self.message |