8000 Fix test_memoryio · RustPython/RustPython@163296d · GitHub
[go: up one dir, main page]

Skip to content

Commit 163296d

Browse files
committed
Fix test_memoryio
1 parent 1ae98ee commit 163296d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

vm/src/stdlib/io.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ mod _io {
259259
}
260260

261261
fn write(&mut self, data: &[u8]) -> Option<u64> {
262+
if data.is_empty() {
263+
return Some(0);
264+
}
262265
let length = data.len();
263266
self.cursor.write_all(data).ok()?;
264267
Some(length as u64)

0 commit comments

Comments
 (0)
0