-{-# OPTIONS_GHC -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -XNoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : System.IO
openBinaryTempFile,
) where
+import Control.Exception hiding (bracket)
+
#ifndef __NHC__
import Data.Bits
import Data.List
#endif
#ifdef __GLASGOW_HASKELL__
-import GHC.Exception as ExceptionBase hiding (catch)
+import GHC.IOBase as ExceptionBase
#endif
#ifdef __HUGS__
import Hugs.Exception as ExceptionBase
-- as any exceptions etc will only be able to report the
-- fd currently
h <- fdToHandle fd
- `ExceptionBase.catchException` \e -> do c_close fd; throw e
+ `ExceptionBase.catchAny` \e -> do c_close fd; throw e
return (filepath, h)
#endif
where
bracket before after thing =
block (do
a <- before
- r <- catchException
+ r <- catchAny
(unblock (thing a))
(\e -> do { after a; throw e })
after a