From 6442ec8c37f93ba29f0df743b6da29913857707e Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 19 Mar 2015 00:03:34 +0100 Subject: [PATCH] SerializingObject: Restrict usage of 'task calc' conversion for those TW versions that contain it --- tasklib/task.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasklib/task.py b/tasklib/task.py index e0e1040..b9103d1 100644 --- a/tasklib/task.py +++ b/tasklib/task.py @@ -262,8 +262,10 @@ class SerializingObject(object): # If the value is already localized, there is no need to change # time zone at this point. Also None is a valid value too. localized = value - elif isinstance(value, six.string_types): + elif (isinstance(value, six.string_types) + and self.warrior.version > VERSION_2_4_0): # For strings, use 'task calc' to evaluate the string to datetime + # available since TW 2.4.0 args = value.split() result = self.warrior.execute_command(['calc'] + args) naive = datetime.datetime.strptime(result[0], DATE_FORMAT_CALC) -- 2.39.5