Commit f460a89b authored by sewardj's avatar sewardj
Browse files

[project @ 2000-02-15 11:24:20 by sewardj]

In hugsprimRunIO_toplevel, use catchException instead of catch.
At least exceptions can then be caught, although Hugs then goes on
to die with an assertion failure in unblockAsyncExceptionszh_ret_entry,
probably caused by wrongly entering it twice in immediate succession.
parent fccd8202
......@@ -32,7 +32,7 @@ import PrelNum
import PrelReal(Integral)
import Prelude(fromIntegral)
import IO(putStr,hFlush,stdout,stderr)
import PrelException(catch)
import PrelException(catch,catchException)
import PrelIOBase(IO,unsafePerformIO)
import PrelShow(show,shows,showString,showChar,Show,ShowS)
import PrelRead(Read,ReadS,lex,reads)
......@@ -129,12 +129,11 @@ hugsprimRunIO_toplevel m
= primCatch (protect (n-1) comp)
(\e -> fst (unST (putStr (show e ++ "\n")) realWorld))
-}
hugsprimRunIO_toplevel :: IO a -> ()
hugsprimRunIO_toplevel m
= unsafePerformIO (
catch (m >> hFlush stderr >> hFlush stdout)
(\e -> putStr (show e ++ "\n"))
)
= unsafePerformIO (
catchException (m >> hFlush stderr >> hFlush stdout)
(\e -> putStr ("error: " ++ show e ++ "\n"))
)
\end{code}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment