Skip to content

Commit 3a5f4ba

Browse files
committed
fix(allocations): ensure that allocations dict does not raise KeyError during finalization
1 parent 52df913 commit 3a5f4ba

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
@@ -1509,7 +1509,7 @@ def _alloc_finalizer(memory_manager, ptr, alloc_key, size):
15091509

15101510
def core():
15111511
if allocations:
1512-
del allocations[alloc_key]
1512+
allocations.pop(alloc_key, None)
15131513
deallocations.add_item(driver.cuMemFree, ptr, size)
15141514

15151515
return core

0 commit comments

Comments
 (0)