Skip to content

Commit 26b8f51

Browse files
authored
Non-NULL check before PyType_Check()
1 parent 3d29380 commit 26b8f51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_datetimemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ _get_current_state(PyObject **p_mod)
164164
{
165165
PyInterpreterState *interp = PyInterpreterState_Get();
166166
datetime_state *st = interp->datetime_module_state;
167-
if (st != NULL) {
167+
if (st != NULL && st->isocalendar_date_type != NULL) {
168168
PyObject *mod = PyType_GetModule(st->isocalendar_date_type);
169169
assert(mod != NULL);
170170
*p_mod = Py_NewRef(mod);

0 commit comments

Comments
 (0)