]> granicus.if.org Git - python/commitdiff
get rid of assert (size >= 0) now that an explicit if (size < 0) is in the code.
authorGregory P. Smith <greg@mad-scientist.com>
Thu, 10 Apr 2008 19:50:36 +0000 (19:50 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Thu, 10 Apr 2008 19:50:36 +0000 (19:50 +0000)
Objects/bytesobject.c
Objects/stringobject.c
Objects/unicodeobject.c

index af7a1b18d96b9a3bdf8e69033058d7fe4d1b403e..0b40f8391ea5646dfd7325d15c6c439ac4f76e8a 100644 (file)
@@ -160,7 +160,6 @@ PyBytes_FromStringAndSize(const char *bytes, Py_ssize_t size)
     PyBytesObject *new;
     Py_ssize_t alloc;
 
-    assert(size >= 0);
     if (size < 0) {
         PyErr_SetString(PyExc_SystemError,
             "Negative size passed to PyBytes_FromStringAndSize");
index f4b42641f0fe75d363efb0e21b5022ffb159fb0d..9f154f3e1e4679f788171ac6708d7a99d1197471 100644 (file)
@@ -55,7 +55,6 @@ PyObject *
 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");
index 43379728cbbae4354d7374ff7f6e700df0fd4bf2..a8e0e11cb3e1e1c2e3dda591896ccfe64587ec8c 100644 (file)
@@ -466,7 +466,6 @@ PyObject *PyUnicode_FromStringAndSize(const char *u, Py_ssize_t size)
 {
     PyUnicodeObject *unicode;
 
-       assert(size <= 0);
        if (size < 0) {
                PyErr_SetString(PyExc_SystemError,
                    "Negative size passed to PyUnicode_FromStringAndSize");