Skip to content

Commit 4b931d4

Browse files
committed
We should ensure that we do hold GIL when calling finalize
1 parent 9347052 commit 4b931d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Python/Internal/Eval.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ finalizePython
171171
| rtsSupportsBoundThreads = runInBoundThread $ do
172172
[CU.exp| void { PyGILState_Ensure() } |]
173173
mask_ doFinalizePython
174-
| otherwise = mask_ doFinalizePython
174+
| otherwise = mask_ $ do
175+
[CU.exp| void { PyGILState_Ensure() } |]
176+
doFinalizePython
175177

176178
-- | Bracket which ensures that action is executed with properly
177179
-- initialized interpreter

0 commit comments

Comments
 (0)