use Py_TYPE macro (no functional changes)
This commit is contained in:
@@ -567,7 +567,7 @@ PyObject * Image_setSource (PyImage * self, PyObject * args)
|
||||
if (self->m_image != NULL)
|
||||
{
|
||||
// check type of object
|
||||
if (pyImageTypes.in(obj->ob_type))
|
||||
if (pyImageTypes.in(Py_TYPE(obj)))
|
||||
{
|
||||
// convert to image struct
|
||||
PyImage * img = reinterpret_cast<PyImage*>(obj);
|
||||
@@ -619,7 +619,7 @@ int Image_setFilter (PyImage * self, PyObject * value, void * closure)
|
||||
if (self->m_image != NULL)
|
||||
{
|
||||
// check new value
|
||||
if (value == NULL || !pyFilterTypes.in(value->ob_type))
|
||||
if (value == NULL || !pyFilterTypes.in(Py_TYPE(value)))
|
||||
{
|
||||
// report value error
|
||||
PyErr_SetString(PyExc_TypeError, "Invalid type of value");
|
||||
|
||||
Reference in New Issue
Block a user