summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-05 13:39:30 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-05 13:39:30 +0200
commit30d97ce8eb9085cff432e89360e8b377cb81f3be (patch)
tree94743515987ea3308eb5e98d74c4ec7979cb9b22
parentdea3d69d7f66a3a6b644ca14e5cd4f807ab60161 (diff)
downloadruamel.yaml-30d97ce8eb9085cff432e89360e8b377cb81f3be.tar.gz
mypy lagging again...
-rw-r--r--constructor.py2
-rw-r--r--emitter.py4
-rw-r--r--scanner.py4
3 files changed, 4 insertions, 6 deletions
diff --git a/constructor.py b/constructor.py
index c830580..c36f01d 100644
--- a/constructor.py
+++ b/constructor.py
@@ -981,7 +981,7 @@ class RoundTripConstructor(SafeConstructor):
if node.style == '|' and isinstance(node.value, text_type):
pss = PreservedScalarString(node.value)
if node.comment and node.comment[1]:
- pss.comment = node.comment[1][0]
+ pss.comment = node.comment[1][0] # type: ignore
return pss
elif bool(self._preserve_quotes) and isinstance(node.value, text_type):
if node.style == "'":
diff --git a/emitter.py b/emitter.py
index a75fa52..e45a0b1 100644
--- a/emitter.py
+++ b/emitter.py
@@ -1335,7 +1335,7 @@ class Emitter(object):
def determine_block_hints(self, text):
# type: (Any) -> Any
- hints = ""
+ hints = u""
if text:
if not self.root_context and text[0] in u' \n\x85\u2028\u2029':
hints += text_type(self.best_sequence_indent)
@@ -1405,7 +1405,7 @@ class Emitter(object):
end += 1
def write_literal(self, text, comment=None):
- # type: (Any) -> None
+ # type: (Any, Any) -> None
hints = self.determine_block_hints(text)
self.write_indicator(u'|' + hints, True)
try:
diff --git a/scanner.py b/scanner.py
index dd77a12..5813c53 100644
--- a/scanner.py
+++ b/scanner.py
@@ -1673,9 +1673,7 @@ class Scanner(object):
if PY3:
value = bytes(code_bytes).decode('utf-8')
else:
- # fmt: off
- value = unicode(b"".join(code_bytes), 'utf-8') # type: ignore
- # fmt: on
+ value = unicode(b"".join(code_bytes), 'utf-8')
except UnicodeDecodeError as exc:
raise ScannerError('while scanning a %s' % name, start_mark, str(exc), mark)
return value