[Python-checkins] r62271 - python/trunk/Objects/bytesobject.c python/trunk/Objects/stringobject.c python/trunk/Objects/unicodeobject.c

gregory.p.smith python-checkins at python.org
Thu Apr 10 21:50:37 CEST 2008


Author: gregory.p.smith
Date: Thu Apr 10 21:50:36 2008
New Revision: 62271

Modified:
   python/trunk/Objects/bytesobject.c
   python/trunk/Objects/stringobject.c
   python/trunk/Objects/unicodeobject.c
Log:
get rid of assert (size >= 0) now that an explicit if (size < 0) is in the code.


Modified: python/trunk/Objects/bytesobject.c
==============================================================================
--- python/trunk/Objects/bytesobject.c	(original)
+++ python/trunk/Objects/bytesobject.c	Thu Apr 10 21:50:36 2008
@@ -160,7 +160,6 @@
     PyBytesObject *new;
     Py_ssize_t alloc;
 
-    assert(size >= 0);
     if (size < 0) {
         PyErr_SetString(PyExc_SystemError,
             "Negative size passed to PyBytes_FromStringAndSize");

Modified: python/trunk/Objects/stringobject.c
==============================================================================
--- python/trunk/Objects/stringobject.c	(original)
+++ python/trunk/Objects/stringobject.c	Thu Apr 10 21:50:36 2008
@@ -55,7 +55,6 @@
 PyString_FromStringAndSize(const char *str, Py_ssize_t size)
 {
 	register PyStringObject *op;
-	assert(size >= 0);
 	if (size < 0) {
 		PyErr_SetString(PyExc_SystemError,
 		    "Negative size passed to PyString_FromStringAndSize");

Modified: python/trunk/Objects/unicodeobject.c
==============================================================================
--- python/trunk/Objects/unicodeobject.c	(original)
+++ python/trunk/Objects/unicodeobject.c	Thu Apr 10 21:50:36 2008
@@ -466,7 +466,6 @@
 {
     PyUnicodeObject *unicode;
 
-	assert(size <= 0);
 	if (size < 0) {
 		PyErr_SetString(PyExc_SystemError,
 		    "Negative size passed to PyUnicode_FromStringAndSize");


More information about the Python-checkins mailing list