commit | 047ce8c452087809f5ab10d7a2ea58c8709a8da3 | [log] [tgz] |
---|---|---|
author | Henry Schreiner <henry.fredrick.schreiner@cern.ch> | Tue Jun 11 16:17:50 2019 -0400 |
committer | Wenzel Jakob <wenzel.jakob@epfl.ch> | Tue Jun 11 23:28:58 2019 +0200 |
tree | 821f146c3536e624a73ea0fea8fc67f2ca929341 | |
parent | 95f750a87d82ad6b996ceae27e68737472ff4809 [diff] |
Fix iostream when used with nogil (#1368)
diff --git a/include/pybind11/iostream.h b/include/pybind11/iostream.h index 9119270..72baef8 100644 --- a/include/pybind11/iostream.h +++ b/include/pybind11/iostream.h
@@ -43,8 +43,11 @@ // 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()); }