File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
import contextlib
2
2
import logging
3
- from importlib .metadata import EntryPoints , entry_points
3
+ from importlib .metadata import EntryPoint , entry_points
4
4
from pathlib import Path
5
5
from typing import Iterator , List
6
6
10
10
_loaded_plugins : List [Plugin ] = []
11
11
12
12
13
- def iter_entry_points (group_name : str ) -> EntryPoints :
13
+ def iter_entry_points (group_name : str ) -> List [EntryPoint ]:
14
+ # Only Python >= 3.10 supports the `EntryPoints` class, so we return
15
+ # a list of `EntryPoint` instead.
14
16
groups = entry_points ()
15
17
if hasattr (groups , "select" ):
16
18
# New interface in Python 3.10 and newer versions of the
17
19
# importlib_metadata backport.
18
- return groups .select (group = group_name )
20
+ return list ( groups .select (group = group_name ) )
19
21
else :
20
22
assert hasattr (groups , "get" )
21
23
# Older interface, deprecated in Python 3.10 and recent
You can’t perform that action at this time.
0 commit comments