# HG changeset patch # User Gregory Szorc # Date 1476387731 -7200 # Node ID f5607b6253da5e5e6ecebd073a8e76b45249f7a5 # Parent 5cb830801855dbb63e98b948e355bc995d295bf3 pathencode: use assert() for PyBytes_Check() This should have been added in a8c948ee3668. I sent the patch to the list prematurely. diff -r 5cb830801855 -r f5607b6253da mercurial/pathencode.c --- 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);