Skip to content

Commit

Permalink
fix: avoid changing class outside of GIL
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Jan 27, 2021
1 parent 683faf2 commit a0ac23e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/pybind11/iostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ class pythonbuf : public std::streambuf {

pywrite(line);
pyflush();

// Placed inside gil_scoped_aquire as a mutex to avoid a race
setp(pbase(), epptr());
}

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

0 comments on commit a0ac23e

Please sign in to comment.