()
| 110 | |
| 111 | |
| 112 | def 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) |
no test coverage detected