X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/a539ffb8538158c1dc7eeb4ad5264a6e995496b6..2a448f86048c26a24288d310b3bb70e8ae7e7528:/bytestring.c?ds=sidebyside diff --git a/bytestring.c b/bytestring.c index 3bf1b25..5fdd5d9 100644 --- a/bytestring.c +++ b/bytestring.c @@ -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: