diff options
author | Anthon van der Neut <anthon@mnt.org> | 2019-08-15 21:45:20 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2019-08-15 21:45:20 +0200 |
commit | 1c628953c71f2e2f0cd01d643ca239e23c2e15cc (patch) | |
tree | 5023362ff0ebc313833d5c84bc358eb6f6d58110 /scanner.py | |
parent | 64185b909c7107f1bc11644aa60bd901f8ec1bdc (diff) | |
download | ruamel.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.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |