MCPcopy
hub / github.com/django/django / iter_all_python_module_files

Function iter_all_python_module_files

django/utils/autoreload.py:112–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110
111
112def iter_all_python_module_files():
113 # This is a hot path during reloading. Create a stable sorted list of
114 # modules based on the module name and pass it to iter_modules_and_files().
115 # This ensures cached results are returned in the usual case that modules
116 # aren't loaded on the fly.
117 keys = sorted(sys.modules)
118 modules = tuple(
119 m
120 for m in map(sys.modules.__getitem__, keys)
121 if not isinstance(m, weakref.ProxyTypes)
122 )
123 return iter_modules_and_files(modules, frozenset(_error_files))
124
125
126@lru_cache(maxsize=1)

Callers 1

watched_filesMethod · 0.85

Calls 1

iter_modules_and_filesFunction · 0.85

Tested by

no test coverage detected