summaryrefslogtreecommitdiff
path: root/scanner.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-08-15 21:45:20 +0200
committerAnthon van der Neut <anthon@mnt.org>2019-08-15 21:45:20 +0200
commit1c628953c71f2e2f0cd01d643ca239e23c2e15cc (patch)
tree5023362ff0ebc313833d5c84bc358eb6f6d58110 /scanner.py
parent64185b909c7107f1bc11644aa60bd901f8ec1bdc (diff)
downloadruamel.yaml-1c628953c71f2e2f0cd01d643ca239e23c2e15cc.tar.gz
move YAML directive info to scanner for TAG parsing of 1.2 URI
1.2 URI can contain the "#" character, but parsing for nodes didn't necessarily make the 1.2 version available in time fixes issue #301 *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 'scanner.py')
-rw-r--r--scanner.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scanner.py b/scanner.py
index 7267cea..69869a5 100644
--- a/scanner.py
+++ b/scanner.py
@@ -81,6 +81,7 @@ class Scanner(object):
self.loader._scanner = self
self.reset_scanner()
self.first_time = False
+ self.yaml_version = None
@property
def flow_level(self):
@@ -955,7 +956,8 @@ class Scanner(object):
"expected a digit or ' ', but found %r" % utf8(srp()),
self.reader.get_mark(),
)
- return (major, minor)
+ self.yaml_version = (major, minor)
+ return self.yaml_version
def scan_yaml_directive_number(self, start_mark):
# type: (Any) -> Any