summaryrefslogtreecommitdiff
path: root/scanner.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2017-06-04 14:27:02 +0200
committerAnthon van der Neut <anthon@mnt.org>2017-06-04 14:27:02 +0200
commita0ff58af5242fddc39236168b18aafb7c8b324da (patch)
treeb7ba0da53b720dde7be6e3b32ad927456c6f5dcf /scanner.py
parent6ba66a44af41d072f5ceddfcdf2c21611c2a7cd0 (diff)
downloadruamel.yaml-a0ff58af5242fddc39236168b18aafb7c8b324da.tar.gz
initial version with YAML class0.15.0
Some new tests are still required
Diffstat (limited to 'scanner.py')
-rw-r--r--scanner.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scanner.py b/scanner.py
index 2f083f5..de7a92a 100644
--- a/scanner.py
+++ b/scanner.py
@@ -72,7 +72,7 @@ class Scanner(object):
# self.forward(l=1) # read the next l characters and move the pointer
self.loader = loader
- if self.loader is not None:
+ if self.loader is not None and getattr(self.loader, '_scanner', None) is None:
self.loader._scanner = self
# Had we reached the end of the stream?
@@ -130,6 +130,8 @@ class Scanner(object):
@property
def reader(self):
# type: () -> Any
+ if hasattr(self.loader, 'typ'):
+ self.loader.reader
return self.loader._reader
# Public methods.