packages feed

inline-python 0.1.1 → 0.1.1.1

raw patch · 3 files changed

+8/−2 lines, 3 files

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+0.1.1.1 [2025.03.10]+--------------------+* Crash of python's main thread when one attempts to interrupt it fixed.+ 0.1.1 [2025.02.13] ------------------ * Number of deadlocks in `runPyInMain` fixed:
inline-python.cabal view
@@ -2,7 +2,7 @@ Build-Type:     Simple  Name:           inline-python-Version:        0.1.1+Version:        0.1.1.1 Synopsis:       Python interpreter embedded into haskell. Description:   This package embeds python interpreter into haskell program and
src/Python/Internal/Eval.hs view
@@ -362,7 +362,7 @@   case r_init of     False -> pure ()     True  -> mask_ $ fix $ \loop ->-      takeMVar lock_eval >>= \case+      (takeMVar lock_eval `catch` (\InterruptMain -> pure HereWeGoAgain)) >>= \case         EvalReq py resp -> do           res <- (Right <$> runPy py) `catch` (pure . Left)           putMVar resp res@@ -373,6 +373,7 @@             Py_Finalize();             } |]           putMVar resp ()+        HereWeGoAgain -> loop   doInializePythonIO :: IO Bool@@ -431,6 +432,7 @@ data EvalReq   = forall a. EvalReq (Py a) (MVar (Either SomeException a))   | StopReq (MVar ())+  | HereWeGoAgain  data InterruptMain = InterruptMain   deriving stock    Show