summaryrefslogtreecommitdiff
path: root/constructor.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-08-17 18:21:31 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-08-17 18:21:31 +0200
commit964ce371e08b0400a0e8c9019b132f43588b86fb (patch)
treec47adbfab6af451f035d362d7249ae7f6f35878f /constructor.py
parent505784248165b4f938534f015a47b568635ae9f5 (diff)
downloadruamel.yaml-964ce371e08b0400a0e8c9019b132f43588b86fb.tar.gz
fix issue 223 Cloader not initialising Resolver version0.15.59
*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 'constructor.py')
-rw-r--r--constructor.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/constructor.py b/constructor.py
index 9408c3c..dddf8bc 100644
--- a/constructor.py
+++ b/constructor.py
@@ -418,6 +418,7 @@ class SafeConstructor(BaseConstructor):
def construct_yaml_int(self, node):
# type: (Any) -> int
+ print('ver', self.resolver.processing_version)
value_s = to_str(self.construct_scalar(node))
value_s = value_s.replace('_', "")
sign = +1
@@ -433,9 +434,9 @@ class SafeConstructor(BaseConstructor):
return sign * int(value_s[2:], 16)
elif value_s.startswith('0o'):
return sign * int(value_s[2:], 8)
- elif self.resolver.processing_version != (1, 2) and value_s[0] == '0':
+ elif self.resolver.processing_version == (1, 1) and value_s[0] == '0':
return sign * int(value_s, 8)
- elif self.resolver.processing_version != (1, 2) and ':' in value_s:
+ elif self.resolver.processing_version == (1, 1) and ':' in value_s:
digits = [int(part) for part in value_s.split(':')]
digits.reverse()
base = 1