Skip to content

Commit 9abd2db

Browse files
committed
fix(allocations): ensure that allocations dict does not raise KeyError during finalization
1 parent fd75271 commit 9abd2db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numba_cuda/numba/cuda/cudadrv/driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ def _alloc_finalizer(memory_manager, ptr, alloc_key, size):
15001500

15011501
def core():
15021502
if allocations:
1503-
del allocations[alloc_key]
1503+
allocations.pop(alloc_key, None)
15041504
deallocations.add_item(driver.cuMemFree, ptr, size)
15051505

15061506
return core

0 commit comments

Comments
 (0)