Skip to content

Commit 19b422a

Browse files
committed
Work around assert in tests with python 3.10 and numba lowering
1 parent caa5335 commit 19b422a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/numba/openmp/omp_ir.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,13 @@ def add_mapped_to_ins(ins, tags):
14891489
for eb in extras_before:
14901490
print(eb)
14911491

1492-
assert len(target_args) == len(target_args_unordered)
1492+
# NOTE: workaround for python 3.10 lowering in numba that may
1493+
# include a branch converging variable $cp. Remove it to avoid the
1494+
# assert since the openmp region must be single-entry, single-exit.
1495+
if sys.version_info >= (3, 10) and sys.version_info < (3, 11):
1496+
assert len(target_args) == len([x for x in target_args_unordered if x != "$cp"])
1497+
else:
1498+
assert len(target_args) == len(target_args_unordered)
14931499
assert len(target_args) == len(outline_arg_typs)
14941500

14951501
# Create the outlined IR from the blocks in the region, making the

0 commit comments

Comments
 (0)