Skip to content

bpo-36485: Add sys.clear_caches(). #12632

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Mar 30, 2019

It calls the __clearcache__() functions for every imported module
if it is defined.

https://bugs.python.org/issue36485

It calls the __clearcache__() functions for every imported module
if it is defined.
@ilevkivskyi
Copy link
Member

I am not sure this is really needed, but FWIW I like this approach more than #12639

/*[clinic end generated code: output=7bbac9db7bbef6c3 input=9e739bbc710495ff]*/
{
_Py_IDENTIFIER(__clearcache__);
PyObject *modules = PyMapping_Values(PyImport_GetModuleDict());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyMapping_Values() should be checked for failure, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants