Fix iostream when used with nogil (#1368)

This commit is contained in:
Henry Schreiner 2019-06-11 16:17:50 -04:00 committed by Wenzel Jakob
parent 95f750a87d
commit 047ce8c452

View File

@ -43,8 +43,11 @@ private:
// This subtraction cannot be negative, so dropping the sign // This subtraction cannot be negative, so dropping the sign
str line(pbase(), static_cast<size_t>(pptr() - pbase())); str line(pbase(), static_cast<size_t>(pptr() - pbase()));
{
gil_scoped_acquire tmp;
pywrite(line); pywrite(line);
pyflush(); pyflush();
}
setp(pbase(), epptr()); setp(pbase(), epptr());
} }