Skip to content

Commit e73e24c

Browse files
committed
Fix build with GHC-8.8
1 parent dd819a8 commit e73e24c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

System/File/OsPath/Internal.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module System.File.OsPath.Internal where
88

99
import qualified System.File.Platform as P
1010

11-
import Prelude ((.), ($), String, IO, ioError, pure, either, const, flip, Maybe(..), fmap, (<$>), id, Bool(..), FilePath, (++), return, show, (>>=), (==), otherwise, errorWithoutStackTrace)
11+
import Prelude ((.), ($), String, IO, ioError, pure, either, const, flip, Maybe(..), fmap, (<$>), id, Bool(..), FilePath, (++), return, show, (>>=), (==), otherwise, errorWithoutStackTrace, userError)
1212
import GHC.IO (catchException)
1313
import GHC.IO.Exception (IOException(..))
1414
import GHC.IO.Handle (hClose_help)
@@ -17,7 +17,7 @@ import GHC.IO.Handle.Types (Handle__, Handle(..))
1717
import Control.Concurrent.MVar
1818
import Control.Monad (void, when)
1919
import Control.DeepSeq (force)
20-
import Control.Exception (SomeException, try, evaluate, mask, onException)
20+
import Control.Exception (SomeException, try, evaluate, mask, onException, throwIO)
2121
import System.IO (IOMode(..), hSetBinaryMode, hClose)
2222
import System.IO.Unsafe (unsafePerformIO)
2323
import System.OsString (osstr)
@@ -28,7 +28,6 @@ import qualified Data.ByteString as BS
2828
import qualified Data.ByteString.Lazy as BSL
2929
import qualified System.OsString as OSS
3030
import System.Posix.Types (CMode)
31-
import GHC.Base (failIO)
3231

3332
-- | Like 'openFile', but open the file in binary mode.
3433
-- On Windows, reading a file in text mode (which is the default)
@@ -234,7 +233,7 @@ openTempFile' :: String -> OsPath -> OsString -> Bool -> CMode
234233
-> IO (OsPath, Handle)
235234
openTempFile' loc (OsString tmp_dir) template@(OsString tmpl) binary mode
236235
| OSS.any (== OSP.pathSeparator) template
237-
= failIO $ "openTempFile': Template string must not contain path separator characters: " ++ P.lenientDecode tmpl
236+
= throwIO $ userError $ "openTempFile': Template string must not contain path separator characters: " ++ P.lenientDecode tmpl
238237
| otherwise = do
239238
(fp, hdl) <- P.findTempName (prefix, suffix) loc tmp_dir mode
240239
when binary $ hSetBinaryMode hdl True

0 commit comments

Comments
 (0)