summaryrefslogtreecommitdiff
path: root/coverage/extension.py
blob: 8c89b88e87403bbd3e2dda59dd6fffa94885d292 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Extension management for coverage.py"""

def load_extensions(modules, name):
    """Load extensions from `modules`, finding them by `name`.

    Yields the loaded extensions.

    """

    for module in modules:
        try:
            __import__(module)
            mod = sys.modules[module]
        except ImportError:
            blah()
            continue

        entry = getattr(mod, name, None)
        if entry:
            yield entry