Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ccdeffb

Browse filesBrowse files
committed
Check ufunc's dict on creation
1 parent 058ea0f commit ccdeffb
Copy full SHA for ccdeffb

File tree

1 file changed

+5
-1
lines changed
Filter options

1 file changed

+5
-1
lines changed

‎numpy/_core/src/umath/ufunc_object.c

Copy file name to clipboardExpand all lines: numpy/_core/src/umath/ufunc_object.c
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4772,6 +4772,10 @@ PyUFunc_FromFuncAndDataAndSignatureAndIdentity(PyUFuncGenericFunction *func, voi
47724772
}
47734773
}
47744774
ufunc->dict = PyDict_New();
4775+
if (ufunc->dict == NULL) {
4776+
Py_DECREF(ufunc);
4777+
return NULL;
4778+
}
47754779
/*
47764780
* TODO: I tried adding a default promoter here (either all object for
47774781
* some special cases, or all homogeneous). Those are reasonable
@@ -5199,7 +5203,7 @@ ufunc_traverse(PyUFuncObject *self, visitproc visit, void *arg)
51995203
if (self->identity == PyUFunc_IdentityValue) {
52005204
Py_VISIT(self->identity_value);
52015205
}
5202-
Py_VISIT(self->dict);
5206+
//Py_VISIT(self->dict);
52035207
return 0;
52045208
}
52055209

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.