]> granicus.if.org Git - python/commitdiff
Coverity #151: Remove deadcode.
authorNeal Norwitz <nnorwitz@gmail.com>
Thu, 4 Oct 2007 06:00:48 +0000 (06:00 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Thu, 4 Oct 2007 06:00:48 +0000 (06:00 +0000)
All this code already exists above starting at line 653.

Objects/bufferobject.c

index 13442c9c4164cc1549c976cc5af6885c798316aa..e01938c2e93c257152e823d328c2b1314dba9b32 100644 (file)
@@ -682,19 +682,6 @@ buffer_ass_subscript(PyBufferObject *self, PyObject *item, PyObject *value)
                                &start, &stop, &step, &slicelength) < 0)
                        return -1;
 
-               pb = value ? value->ob_type->tp_as_buffer : NULL;
-               if (pb == NULL ||
-                   pb->bf_getreadbuffer == NULL ||
-                   pb->bf_getsegcount == NULL) {
-                       PyErr_BadArgument();
-                       return -1;
-               }
-               if ((*pb->bf_getsegcount)(value, NULL) != 1) {
-                       /* ### use a different exception type/message? */
-                       PyErr_SetString(PyExc_TypeError,
-                                       "single-segment buffer object expected");
-                       return -1;
-               }
                if ((othersize = (*pb->bf_getreadbuffer)(value, 0, &ptr2)) < 0)
                        return -1;