1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 def iter_modules_in_path(*paths
):
10 paths
= [os
.path
.abspath(os
.path
.normcase(p
)) + os
.sep
for p
in paths
]
11 for name
, module
in sys
.modules
.items():
12 if getattr(module
, "__file__", None) is None:
14 if module
.__file
__ is None:
16 path
= module
.__file
__
18 if path
.endswith(".pyc"):
20 path
= os
.path
.abspath(os
.path
.normcase(path
))
22 if any(path
.startswith(p
) for p
in paths
):