From ec7a80bff8bf33232a1b48b9d814648db8ca5fda Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 4 Apr 2002 08:49:46 +0000 Subject: [PATCH] [project @ 2002-04-04 08:49:46 by simonmar] An I/O error while opening/writing the output file is *not* a panic. --- ghc/compiler/main/CodeOutput.lhs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs index 9e0dada..166c099 100644 --- a/ghc/compiler/main/CodeOutput.lhs +++ b/ghc/compiler/main/CodeOutput.lhs @@ -93,12 +93,7 @@ codeOutput dflags mod_name tycons core_binds stg_binds } doOutput :: String -> (Handle -> IO ()) -> IO () -doOutput filenm io_action - = (do handle <- openFile filenm WriteMode - io_action handle - hClose handle) - `catch` (\err -> pprPanic "Failed to open or write code output file" - (text filenm)) +doOutput filenm io_action = bracket (openFile filenm WriteMode) hClose io_action \end{code} -- 1.7.10.4