File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
numpy/_core/src/multiarray Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -38,28 +38,19 @@ static void dlpack_capsule_deleter(PyObject *self) {
38
38
return ;
39
39
}
40
40
41
- /* an exception may be in-flight, we must save it in case we create another one */
42
- PyObject * type , * value , * traceback ;
43
- PyErr_Fetch (& type , & value , & traceback );
44
-
45
41
DLManagedTensor * managed =
46
42
(DLManagedTensor * )PyCapsule_GetPointer (self , NPY_DLPACK_CAPSULE_NAME );
47
43
if (managed == NULL ) {
48
44
PyErr_WriteUnraisable (self );
49
- goto done ;
45
+ return ;
50
46
}
51
47
/*
52
- * the spec says the deleter can be NULL if there is no way for the caller
48
+ * The spec says the deleter can be NULL if there is no way for the caller
53
49
* to provide a reasonable destructor.
54
50
*/
55
51
if (managed -> deleter ) {
56
52
managed -> deleter (managed );
57
- /* TODO: is the deleter allowed to set a python exception? */
58
- assert (!PyErr_Occurred ());
59
53
}
60
-
61
- done :
62
- PyErr_Restore (type , value , traceback );
63
54
}
64
55
65
56
/* used internally, almost identical to dlpack_capsule_deleter() */
You can’t perform that action at this time.
0 commit comments