Check PyLong_AsVoidPtr result (#9548)

This commit is contained in:
Andrew Murray 2026-04-24 21:04:00 +10:00 committed by GitHub
commit a0cd878bed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,8 +33,10 @@ _tkinit(PyObject *self, PyObject *args) {
}
interp = (Tcl_Interp *)PyLong_AsVoidPtr(arg);
if (interp == NULL && PyErr_Occurred()) {
return NULL;
}
/* This will bomb if interp is invalid... */
TkImaging_Init(interp);
Py_RETURN_NONE;