Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions include/pybind11/iostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ class pythonbuf : public std::streambuf {
// This subtraction cannot be negative, so dropping the sign
str line(pbase(), static_cast<size_t>(pptr() - pbase()));

pywrite(line);
pyflush();
{
gil_scoped_acquire tmp;
pywrite(line);
pyflush();
}

setp(pbase(), epptr());
}
Expand Down