From: Siu Kwan Lam <1929845+sklam@users.noreply.github.com>
Origin: https://github.com/numba/numba/pull/8545
Date: Wed, 30 Nov 2022 12:52:15 -0600
Subject: Address review in transforms.py

---
 numba/core/transforms.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/numba/core/transforms.py b/numba/core/transforms.py
index 442d25a..2e72adc 100644
--- a/numba/core/transforms.py
+++ b/numba/core/transforms.py
@@ -481,8 +481,7 @@ def _legalize_with_head(blk):
     counters = defaultdict(int)
     for stmt in blk.body:
         counters[type(stmt)] += 1
-
-    if counters.pop(ir.EnterWith, 0) != 1:
+    if counters.pop(ir.EnterWith) != 1:
         raise errors.CompilerError(
             "with's head-block must have exactly 1 ENTER_WITH",
             loc=blk.loc,
@@ -510,6 +509,7 @@ def _cfg_nodes_in_region(cfg, region_begin, region_end):
     while stack:
         tos = stack.pop()
         succlist = list(cfg.successors(tos))
+        # a single block function will have a empty sucessor list
         if succlist:
             succs, _ = zip(*succlist)
             nodes = set([node for node in succs
