summary refs log tree commit diff stats
path: root/lib/std/assertions.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/assertions.nim')
-rw-r--r--lib/std/assertions.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/std/assertions.nim b/lib/std/assertions.nim
index 03bab1b1b..5623ff8ef 100644
--- a/lib/std/assertions.nim
+++ b/lib/std/assertions.nim
@@ -98,6 +98,7 @@ template doAssertRaises*(exception: typedesc, code: untyped) =
   const begin = "expected raising '" & astToStr(exception) & "', instead"
   const msgEnd = " by: " & astToStr(code)
   template raisedForeign {.gensym.} = raiseAssert(begin & " raised foreign exception" & msgEnd)
+  {.warning[BareExcept]:off.}
   when Exception is exception:
     try:
       if true:
@@ -116,5 +117,6 @@ template doAssertRaises*(exception: typedesc, code: untyped) =
       mixin `$` # alternatively, we could define $cstring in this module
       raiseAssert(begin & " raised '" & $e.name & "'" & msgEnd)
     except: raisedForeign()
+  {.warning[BareExcept]:on.}
   if wrong:
     raiseAssert(begin & " nothing was raised" & msgEnd)