File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 29
29
30
30
try :
31
31
from importlib .metadata import entry_points
32
+
32
33
entry = entry_points ()
33
- if 'can.interface' in entry :
34
- BACKENDS .update ({interface .name : tuple (interface .value .split (':' )) for interface in entry ['can.interface' ]})
34
+ if "can.interface" in entry :
35
+ BACKENDS .update (
36
+ {
37
+ interface .name : tuple (interface .value .split (":" ))
38
+ for interface in entry ["can.interface" ]
39
+ }
40
+ )
35
41
except ImportError :
36
42
from pkg_resources import iter_entry_points
43
+
37
44
entry = iter_entry_points ("can.interface" )
38
- BACKENDS .update ({interface .name : (interface .module_name , interface .attrs [0 ]) for interface in entry })
45
+ BACKENDS .update (
46
+ {
47
+ interface .name : (interface .module_name , interface .attrs [0 ])
48
+ for interface in entry
49
+ }
50
+ )
39
51
40
52
VALID_INTERFACES = frozenset (list (BACKENDS .keys ()))
You can’t perform that action at this time.
0 commit comments