Skip to content

Commit 7f9cf7d

Browse files
committed
bytes.istitle returns false when the bytes is empty.
1 parent 3af8d1a commit 7f9cf7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vm/src/bytes_inner.rs

+4
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ impl PyBytesInner {
379379
}
380380

381381
pub fn istitle(&self) -> bool {
382+
if self.elements.is_empty() {
383+
return false;
384+
}
385+
382386
std::iter::once(&b' ')
383387
.chain(self.elements.iter())
384388
.zip(self.elements.iter())

0 commit comments

Comments
 (0)