mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 12:30:19 +00:00
some fix
This commit is contained in:
parent
0cc3b77017
commit
060e4b8c1f
@ -78,7 +78,9 @@ void FileIO::_register(VM* vm, PyObject* mod, PyObject* type){
|
||||
PK_ASSERT(actual_size <= buffer_size);
|
||||
// in text mode, CR may be dropped, which may cause `actual_size < buffer_size`
|
||||
Bytes b(buffer, actual_size);
|
||||
if(io.is_text) return VAR(b.str());
|
||||
if(io.is_text){
|
||||
return VAR(std::string_view((char*)b.data(), b.size()));
|
||||
}
|
||||
return VAR(std::move(b));
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user