mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-21 06:45:27 +00:00
silence mass dump of BareExcept when using unittest (#25260)
Seems better to change it to `CatchableError` instead?
(cherry picked from commit cc4c7377b2)
This commit is contained in:
committed by
narimiran
parent
38384d040a
commit
c75c85cbf8
@@ -394,8 +394,9 @@ proc semTry(c: PContext, n: PNode; flags: TExprFlags; expectedType: PType = nil)
|
||||
elif a.len == 1:
|
||||
# count number of ``except: body`` blocks
|
||||
inc catchAllExcepts
|
||||
message(c.config, a.info, warnBareExcept,
|
||||
"The bare except clause is deprecated; use `except CatchableError:` instead")
|
||||
if noPanicOnExcept in c.graph.config.legacyFeatures:
|
||||
message(c.config, a.info, warnBareExcept,
|
||||
"The bare except clause is deprecated; use `except CatchableError:` instead")
|
||||
else:
|
||||
# support ``except KeyError, ValueError, ... : body``
|
||||
if catchAllExcepts > 0:
|
||||
|
||||
Reference in New Issue
Block a user