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.
pull/484/head
c-holtermann 7 years ago
parent 3884e6abf5
commit db9e98a812

@ -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;
}

Loading…
Cancel
Save