summaryrefslogtreecommitdiff
path: root/constructor.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-01-16 08:14:14 +0100
committerAnthon van der Neut <anthon@mnt.org>2019-01-16 08:14:14 +0100
commit713d6c65fd545c6ad38d73686cfb040fd6dc217d (patch)
treeb86dd2a676dd50ea30311d163bcfb7614c36078f /constructor.py
parentdf566d79c442daceb169454a1003c39e9e71b325 (diff)
downloadruamel.yaml-713d6c65fd545c6ad38d73686cfb040fd6dc217d.tar.gz
insert merge key in old (absolute) position0.15.86
Diffstat (limited to 'constructor.py')
-rw-r--r--constructor.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/constructor.py b/constructor.py
index 53e0d27..3f11c56 100644
--- a/constructor.py
+++ b/constructor.py
@@ -599,6 +599,14 @@ class SafeConstructor(BaseConstructor):
delta = datetime.timedelta(hours=tz_hour, minutes=tz_minute)
if values['tz_sign'] == '-':
delta = -delta
+ # should do something else instead (or hook this up to the preceding if statement
+ # in reverse
+ # if delta is None:
+ # return datetime.datetime(year, month, day, hour, minute, second, fraction)
+ # return datetime.datetime(year, month, day, hour, minute, second, fraction,
+ # datetime.timezone.utc)
+ # the above is not good enough though, should provide tzinfo. In Python3 that is easily
+ # doable drop that kind of support for Python2 as it has not native tzinfo
data = datetime.datetime(year, month, day, hour, minute, second, fraction)
if delta:
data -= delta