summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-08-15 22:37:48 +0200
committerAnthon van der Neut <anthon@mnt.org>2019-08-15 22:37:48 +0200
commit909171f93bbad505d35f2856e0105f173858ea5f (patch)
tree2f60cc5be35af933c2c3267694e0a712cf29578b /main.py
parent1c628953c71f2e2f0cd01d643ca239e23c2e15cc (diff)
downloadruamel.yaml-909171f93bbad505d35f2856e0105f173858ea5f.tar.gz
mypy, split contruct_object0.16.3
fixes issue #306 *When this change indeed resolves your problem, please **Close** this issue*. *(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to 'main.py')
-rw-r--r--main.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/main.py b/main.py
index 2d5103e..999f957 100644
--- a/main.py
+++ b/main.py
@@ -35,7 +35,7 @@ from ruamel.yaml.constructor import (
from ruamel.yaml.loader import Loader as UnsafeLoader
if False: # MYPY
- from typing import List, Set, Dict, Union, Any, Callable # NOQA
+ from typing import List, Set, Dict, Union, Any, Callable, Optional, Text # NOQA
from ruamel.yaml.compat import StreamType, StreamTextType, VersionType # NOQA
if PY3:
@@ -99,9 +99,9 @@ class YAML(object):
self.default_flow_style = False
# no optimized rt-dumper yet
self.Emitter = ruamel.yaml.emitter.Emitter # type: Any
- self.Serializer = ruamel.yaml.serializer.Serializer # type: Any
+ self.Serializer = ruamel.yaml.serializer.Serializer
self.Representer = ruamel.yaml.representer.RoundTripRepresenter # type: Any
- self.Scanner = ruamel.yaml.scanner.RoundTripScanner # type: Any
+ self.Scanner = ruamel.yaml.scanner.RoundTripScanner
# no optimized rt-parser yet
self.Parser = ruamel.yaml.parser.RoundTripParser # type: Any
self.Composer = ruamel.yaml.composer.Composer # type: Any
@@ -326,7 +326,7 @@ class YAML(object):
"""
if not hasattr(stream, 'read') and hasattr(stream, 'open'):
# pathlib.Path() instance
- with stream.open('rb') as fp: # type: ignore
+ with stream.open('rb') as fp:
return self.load(fp)
constructor, parser = self.get_constructor_parser(stream)
try:
@@ -351,7 +351,7 @@ class YAML(object):
)
if not hasattr(stream, 'read') and hasattr(stream, 'open'):
# pathlib.Path() instance
- with stream.open('r') as fp: # type: ignore
+ with stream.open('r') as fp:
for d in self.load_all(fp, _kw=enforce):
yield d
return