From: Tomas Mlcoch Date: Tue, 12 Aug 2014 08:01:53 +0000 (+0200) Subject: Python: Call PyDateTime_IMPORT before each call of function related to PyDateTime... X-Git-Tag: upstream/0.10.0~173 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=daf63a330e8eb41d567128d29a9683614de4e3cd;p=services%2Fcreaterepo_c.git Python: Call PyDateTime_IMPORT before each call of function related to PyDateTime (to prevent SIGSEV) --- diff --git a/src/python/updaterecord-py.c b/src/python/updaterecord-py.c index 8ed4129..b370f88 100644 --- a/src/python/updaterecord-py.c +++ b/src/python/updaterecord-py.c @@ -266,6 +266,8 @@ get_str(_UpdateRecordObject *self, void *member_offset) static PyObject * get_datetime(_UpdateRecordObject *self, void *member_offset) { + PyDateTime_IMPORT; + if (check_UpdateRecordStatus(self)) return NULL; cr_UpdateRecord *rec = self->record; @@ -325,6 +327,8 @@ set_str(_UpdateRecordObject *self, PyObject *value, void *member_offset) static int set_datetime(_UpdateRecordObject *self, PyObject *value, void *member_offset) { + PyDateTime_IMPORT; + if (check_UpdateRecordStatus(self)) return -1; if (!PyDateTime_Check(value) && value != Py_None) {