@@ -48,6 +48,8 @@ import Text.Pandoc.Writers.Markdown ( writePlain )
4848import Data.Char ( toLower )
4949import Network.URI ( unEscapeString )
5050import Text.Pandoc.MIME (getMimeType)
51+import Prelude hiding (catch)
52+import Control.Exception (catch, SomeException)
5153
5254-- | Produce an EPUB file from a Pandoc document.
5355writeEPUB :: Maybe String -- ^ EPUB stylesheet specified at command line
@@ -127,7 +129,7 @@ writeEPUB mbStylesheet fonts opts doc@(Pandoc meta _) = do
127129
128130 -- contents.opf
129131 localeLang <- catch (liftM (takeWhile (/='.')) $ getEnv "LANG")
130− (\_ -> return "en-US")
132+ (\e -> let _ = (e :: SomeException) in return "en-US")
131133 let lang = case lookup "lang" (writerVariables opts') of
132134 Just x -> x
133135 Nothing -> localeLang