File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 5
5
###############################################################################
6
6
from typing import List , Iterable , Generic , TypeVar
7
7
import logging
8
- import pkg_resources
8
+ import importlib . metadata
9
9
10
10
from migrant import exceptions
11
11
@@ -115,10 +115,10 @@ def create_backend(cfg):
115
115
116
116
117
117
def get_backend (name ):
118
- backends = list ( pkg_resources . iter_entry_points ( "migrant" , name ) )
118
+ backends = importlib . metadata . entry_points ( group = "migrant" ). select ( name = name )
119
119
if not backends :
120
120
raise exceptions .BackendNotRegistered (name )
121
121
if len (backends ) > 1 :
122
122
raise exceptions .BackendNameConflict (backends )
123
- pcls = backends [0 ].load ()
123
+ pcls = backends [name ].load ()
124
124
return pcls
You can’t perform that action at this time.
0 commit comments