Skip to content

Commit e1c9cdf

Browse files
authored
Tweak 2b6c12a
1 parent 8d94b2f commit e1c9cdf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Modules/_datetimemodule.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7191,7 +7191,6 @@ init_state(datetime_state *st, PyObject *module, PyObject *old_module)
71917191
assert(old_module != module);
71927192
datetime_state *st_old = get_module_state(old_module);
71937193
*st = (datetime_state){
7194-
.module = st->module,
71957194
.isocalendar_date_type = st->isocalendar_date_type,
71967195
.us_per_ms = Py_NewRef(st_old->us_per_ms),
71977196
.us_per_second = Py_NewRef(st_old->us_per_second),
@@ -7336,7 +7335,6 @@ _datetime_exec(PyObject *module)
73367335
}
73377336
}
73387337

7339-
st->module = Py_NewRef(module);
73407338
if (init_state(st, module, old_module) < 0) {
73417339
goto error;
73427340
}
@@ -7446,12 +7444,12 @@ _datetime_exec(PyObject *module)
74467444
if (set_current_module(interp, module) < 0) {
74477445
goto error;
74487446
}
7447+
st->module = Py_NewRef(module);
74497448

74507449
rc = 0;
74517450
goto finally;
74527451

74537452
error:
7454-
Py_CLEAR(st->module);
74557453
clear_state(st);
74567454

74577455
finally:

0 commit comments

Comments
 (0)