pathencode: use assert() for PyBytes_Check()
authorGregory Szorc <gregory.szorc@gmail.com>
Thu, 13 Oct 2016 21:42:11 +0200
changeset 30163 f5607b6253da
parent 30162 5cb830801855
child 30164 1c518d69d994
pathencode: use assert() for PyBytes_Check() This should have been added in a8c948ee3668. I sent the patch to the list prematurely.
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);