From db9e98a812daf6d293f29c6ed07a50dd28b8f70e Mon Sep 17 00:00:00 2001 From: c-holtermann Date: Sat, 6 Apr 2019 16:10:04 +0200 Subject: [PATCH] also allow datetime.date Initialisation of some business objects has been done with datetime.date.today() and it is also mentioned as a possibility in the source doc. So leave it possible. --- bindings/python/time64.i | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/python/time64.i b/bindings/python/time64.i index dfedfa6354..1840b87c60 100644 --- a/bindings/python/time64.i +++ b/bindings/python/time64.i @@ -35,8 +35,8 @@ %typemap(in) time64 { PyDateTime_IMPORT; - if (!PyDateTime_Check($input) && !PyInt_Check($input)) { - PyErr_SetString(PyExc_ValueError,"datetime or integer expected"); + if (!PyDate_Check($input) && !PyDateTime_Check($input) && !PyInt_Check($input)) { + PyErr_SetString(PyExc_ValueError,"date, datetime or integer expected"); return NULL; } @@ -79,8 +79,8 @@ %typemap(in) time64 * (time64 secs) { PyDateTime_IMPORT; - if (!PyDateTime_Check($input) && !PyInt_Check($input)) { - PyErr_SetString(PyExc_ValueError,"datetime or integer expected"); + if (!PyDate_Check($input) && !PyDateTime_Check($input) && !PyInt_Check($input)) { + PyErr_SetString(PyExc_ValueError,"date, datetime or integer expected"); return NULL; }