diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-11-19 13:43:21 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-12-14 20:53:51 -0500 |
commit | 71ecb55b0b3ada2c9841dbc9f4a36fed52eb652e (patch) | |
tree | 9b0b32c271c5de52da86a0216cd49bb6ac532a7e /compiler/GHC/Driver/Pipeline | |
parent | 4f654071850e211370199dddefffbe4a85cd6040 (diff) | |
download | haskell-71ecb55b0b3ada2c9841dbc9f4a36fed52eb652e.tar.gz |
compiler: Use withFile instead of bracket
A minor refactoring noticed by hlint.
Diffstat (limited to 'compiler/GHC/Driver/Pipeline')
-rw-r--r-- | compiler/GHC/Driver/Pipeline/Execute.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Pipeline/Execute.hs b/compiler/GHC/Driver/Pipeline/Execute.hs index cc74b2f3f4..ef311c64ff 100644 --- a/compiler/GHC/Driver/Pipeline/Execute.hs +++ b/compiler/GHC/Driver/Pipeline/Execute.hs @@ -54,7 +54,6 @@ import System.Directory import System.FilePath import GHC.Utils.Misc import GHC.Utils.Outputable -import qualified Control.Exception as Exception import GHC.Unit.Info import GHC.Unit.State import GHC.Unit.Home @@ -1168,7 +1167,7 @@ joinObjectFiles logger tmpfs dflags o_files output_fn = do getHCFilePackages :: FilePath -> IO [UnitId] getHCFilePackages filename = - Exception.bracket (openFile filename ReadMode) hClose $ \h -> do + withFile filename ReadMode $ \h -> do l <- hGetLine h case l of '/':'*':' ':'G':'H':'C':'_':'P':'A':'C':'K':'A':'G':'E':'S':rest -> |