summaryrefslogtreecommitdiff
path: root/error.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-06-07 11:46:23 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-06-07 11:46:23 +0200
commit90583069b7efd3744e46ba65499d7090e09d70c3 (patch)
treef8ab1d58fd1492d9c8a4510dadf78b6fbbc0117a /error.py
parent0cd057811100327978829dcef723d11e78c8efc2 (diff)
downloadruamel.yaml-90583069b7efd3744e46ba65499d7090e09d70c3.tar.gz
fix issue # 123: type annotations0.15.2
mypy needed updating from 0.501 to 0.511, with may different warnings/errors then before
Diffstat (limited to 'error.py')
-rw-r--r--error.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/error.py b/error.py
index 6276ac2..9ecd7ed 100644
--- a/error.py
+++ b/error.py
@@ -101,7 +101,7 @@ class YAMLError(Exception):
class MarkedYAMLError(YAMLError):
def __init__(self, context=None, context_mark=None,
problem=None, problem_mark=None, note=None, warn=None):
- # type: (Any, Any, Any, Any, Any) -> None
+ # type: (Any, Any, Any, Any, Any, Any) -> None
self.context = context
self.context_mark = context_mark
self.problem = problem
@@ -125,7 +125,7 @@ class MarkedYAMLError(YAMLError):
if self.problem_mark is not None:
lines.append(str(self.problem_mark))
if self.note is not None and self.note:
- note = textwrap.dedent(self.note)
+ note = textwrap.dedent(self.note) # type: ignore
lines.append(note)
return '\n'.join(lines)
@@ -141,11 +141,12 @@ class YAMLWarning(Warning):
class MarkedYAMLWarning(YAMLWarning):
def __init__(self, context=None, context_mark=None,
problem=None, problem_mark=None, note=None, warn=None):
- # type: (Any, Any, Any, Any, Any) -> None
+ # type: (Any, Any, Any, Any, Any, Any) -> None
self.context = context
self.context_mark = context_mark
self.problem = problem
self.problem_mark = problem_mark
+ self.note = note
self.warn = warn
def __str__(self):
@@ -164,10 +165,10 @@ class MarkedYAMLWarning(YAMLWarning):
if self.problem_mark is not None:
lines.append(str(self.problem_mark))
if self.note is not None and self.note:
- note = textwrap.dedent(self.note)
+ note = textwrap.dedent(self.note) # type: ignore
lines.append(note)
if self.warn is not None and self.warn:
- warn = textwrap.dedent(self.warn)
+ warn = textwrap.dedent(self.warn) # type: ignore
lines.append(warn)
return '\n'.join(lines)
@@ -198,7 +199,7 @@ class YAMLFutureWarning(Warning):
class MarkedYAMLFutureWarning(YAMLFutureWarning):
def __init__(self, context=None, context_mark=None,
problem=None, problem_mark=None, note=None, warn=None):
- # type: (Any, Any, Any, Any, Any) -> None
+ # type: (Any, Any, Any, Any, Any, Any) -> None
self.context = context
self.context_mark = context_mark
self.problem = problem
@@ -223,9 +224,9 @@ class MarkedYAMLFutureWarning(YAMLFutureWarning):
if self.problem_mark is not None:
lines.append(str(self.problem_mark))
if self.note is not None and self.note:
- note = textwrap.dedent(self.note)
+ note = textwrap.dedent(self.note) # type: ignore
lines.append(note)
if self.warn is not None and self.warn:
- warn = textwrap.dedent(self.warn)
+ warn = textwrap.dedent(self.warn) # type: ignore
lines.append(warn)
return '\n'.join(lines)