Skip to content

Commit

Permalink
Improve error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
sklam committed Aug 14, 2018
1 parent f2b760b commit 995fdda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numba/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ def _get_with_contextmanager(func_ir, blocks, blk_start):
ctxobj = dfn.value
if ctxobj is ir.UNDEFINED:
raise errors.CompilerError(
"Undefined variable used as contextmanager",
"Undefined variable used as context manager",
loc=blocks[blk_start].loc,
)
if not hasattr(ctxobj, 'mutate_with_body'):
raise errors.CompilerError(
"Unsupported use of contextmanager",
"Unsupported context manager in use",
loc=blocks[blk_start].loc,
)
return ctxobj
Expand Down

0 comments on commit 995fdda

Please sign in to comment.