Mercurial > hg
diff mercurial/pathencode.c @ 30163:f5607b6253da
pathencode: use assert() for PyBytes_Check()
This should have been added in a8c948ee3668. I sent the patch to the
list prematurely.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 13 Oct 2016 21:42:11 +0200 |
parents | a8c948ee3668 |
children |
line wrap: on
line diff
--- a/mercurial/pathencode.c Wed Oct 12 12:22:18 2016 +0200 +++ b/mercurial/pathencode.c Thu Oct 13 21:42:11 2016 +0200 @@ -639,7 +639,7 @@ memcopy(dest, &destlen, destsize, &src[lastdot], len - lastdot - 1); - PyBytes_Check(ret); + assert(PyBytes_Check(ret)); Py_SIZE(ret) = destlen; return ret; @@ -752,7 +752,7 @@ newobj = PyBytes_FromStringAndSize(NULL, newlen); if (newobj) { - PyBytes_Check(newobj); + assert(PyBytes_Check(newobj)); Py_SIZE(newobj)--; basicencode(PyBytes_AS_STRING(newobj), newlen, path, len + 1);