From 0c028669642ae4a5937bbb2f3c4344280eec283c Mon Sep 17 00:00:00 2001 From: c-holtermann Date: Sat, 6 Apr 2019 17:13:41 +0200 Subject: [PATCH] PyDate_Check works for date and datetime --- 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 1840b87c60..295a99a797 100644 --- a/bindings/python/time64.i +++ b/bindings/python/time64.i @@ -35,12 +35,12 @@ %typemap(in) time64 { PyDateTime_IMPORT; - if (!PyDate_Check($input) && !PyDateTime_Check($input) && !PyInt_Check($input)) { + if (!PyDate_Check($input) && !PyInt_Check($input)) { PyErr_SetString(PyExc_ValueError,"date, datetime or integer expected"); return NULL; } - if (PyDateTime_Check($input)) { + if (PyDate_Check($input)) { struct tm time = {PyDateTime_DATE_GET_SECOND($input), PyDateTime_DATE_GET_MINUTE($input), PyDateTime_DATE_GET_HOUR($input), @@ -79,12 +79,12 @@ %typemap(in) time64 * (time64 secs) { PyDateTime_IMPORT; - if (!PyDate_Check($input) && !PyDateTime_Check($input) && !PyInt_Check($input)) { + if (!PyDate_Check($input) && !PyInt_Check($input)) { PyErr_SetString(PyExc_ValueError,"date, datetime or integer expected"); return NULL; } - if (PyDateTime_Check($input)) { + if (PyDate_Check($input)) { struct tm time = {PyDateTime_DATE_GET_SECOND($input), PyDateTime_DATE_GET_MINUTE($input), PyDateTime_DATE_GET_HOUR($input),