8000 gh-120782: Update internal type cache when reloading datetime by neonene · Pull Request #120829 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120782: Update internal type cache when reloading datetime #120829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
invalidate type caches on reload
  • Loading branch information
neonene authored Jun 21, 2024
commit 7c1028454387b125c5fd6648235be7dd8a0aac68
6 changes: 6 additions & 0 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7296,6 +7296,12 @@ _datetime_exec(PyObject *module)
static_assert(DI100Y == 25 * DI4Y - 1, "DI100Y");
assert(DI100Y == days_before_year(100+1));

if (reloading) {
for (size_t i = 0; i < Py_ARRAY_LENGTH(capi_types); i++) {
PyType_Modified(capi_types[i]);
}
}

if (set_current_module(interp, module) < 0) {
goto error;
}
Expand Down
Loading
0