Skip to content

Commit b46f651

Browse files
committed
Consistent GIL handling
1 parent ecbc781 commit b46f651

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gcp/src/ARCFileReader.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,8 @@ void ARCFileReader::Process(G3FramePtr frame, std::deque<G3FramePtr> &out)
788788
int32_t size, opcode;
789789
uint8_t *buffer;
790790

791-
py::gil_scoped_release gil;
791+
auto gil = Py_IsInitialized() ?
792+
std::make_unique<py::gil_scoped_release>() : nullptr;
792793

793794
try {
794795
while (stream_.peek() == EOF) {

0 commit comments

Comments
 (0)