◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
5 changes: 5 additions & 0 deletions Lib/test/test_sqlite3/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,11 @@ def test_blob_get_slice(self):
def test_blob_get_empty_slice(self):
self.assertEqual(self.blob[5:5], b"")

def test_blob_get_slice_negative_index(self):
self.assertEqual(self.blob[5:-5], self.data[5:-5])

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
4 changes: 4 additions & 0 deletions Modules/_sqlite/blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ subscript_slice(pysqlite_Blob *self, PyObject *item)
return NULL;
}

if (step == 1) {
return read_multiple(self, len, start);
}
Expand Down
Loading
Toggle all file notes Toggle all file annotations