File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Original file line number Diff line number Diff line change @@ -677,6 +677,10 @@ def CheckBlobRepeateNotSupported(self):
677
677
with self .assertRaises (SystemError ):
678
678
self .blob * 5
679
679
680
+ def CheckBlobContainsNotSupported (self ):
681
+ with self .assertRaises (SystemError ):
682
+ b"aaaaa" in self .blob
683
+
680
684
@unittest .skipUnless (threading , 'This test requires threading.' )
681
685
class ThreadTests (unittest .TestCase ):
682
686
def setUp (self ):
Original file line number Diff line number Diff line change @@ -327,6 +327,15 @@ static PyObject* pysqlite_blob_repeat(pysqlite_Blob *self, PyObject *args)
327
327
return NULL ;
328
328
}
329
329
330
+ static int pysqlite_blob_contains (pysqlite_Blob * self , PyObject * args )
331
+ {
332
+ if (pysqlite_check_blob (self )) {
333
+ PyErr_SetString (PyExc_SystemError ,
334
+ "Blob don't support cotains operation" );
335
+ }
336
+ return -1 ;
337
+ }
338
+
330
339
static PyObject * pysqlite_blob_item (pysqlite_Blob * self , Py_ssize_t i )
331
340
{
332
341
if (!pysqlite_check_blob (self )) {
@@ -606,6 +615,7 @@ static PySequenceMethods blob_sequence_methods = {
606
615
.sq_repeat = (ssizeargfunc )pysqlite_blob_repeat ,
607
616
.sq_item = (ssizeargfunc )pysqlite_blob_item ,
608
617
.sq_ass_item = (ssizeobjargproc )pysqlite_blob_ass_item ,
618
+ .sq_contains = (objobjproc )pysqlite_blob_contains ,
609
619
};
610
620
611
621
static PyMappingMethods blob_mapping_methods = {
You can’t perform that action at this time.
0 commit comments