*.c: Use the new `Py_TYPE' and `Py_SIZE' macros; define them if necessary.
[catacomb-python] / bytestring.c
index 3bf1b25..5fdd5d9 100644 (file)
@@ -192,7 +192,7 @@ static PyObject *bytestring_pyslice(PyObject *me, Py_ssize_t i, Py_ssize_t j)
   if (j < 0) j = 0;
   else if (j > n) j = n;
   if (j < i) i = j = 0;
-  if (i == 0 && j == n && me->ob_type == bytestring_pytype)
+  if (i == 0 && j == n && Py_TYPE(me) == bytestring_pytype)
     { Py_INCREF(me); rc = me; goto end; }
   rc = bytestring_pywrap(PyString_AS_STRING(me) + i, j - i);
 end: