File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1015,9 +1015,18 @@ def version(distribution_name):
10151015 return distribution (distribution_name ).version
10161016
10171017
1018+ def _compat_normalized_name (dist : Distribution ) -> Optional [str ]:
1019+ """
1020+ Compatibility layer that honor name normalization for distributions
1021+ that don't provide ``_normalized_name``
1022+ (as in ``importlib.metadata`` for Python 3.8/3.9).
1023+ """
1024+ return getattr (dist , '_normalized_name' , None ) or Prepared .normalize (dist .name )
1025+
1026+
10181027_unique = functools .partial (
10191028 unique_everseen ,
1020- key = operator . attrgetter ( '_normalized_name' ) ,
1029+ key = _compat_normalized_name ,
10211030)
10221031"""
10231032Wrapper for ``distributions`` to return unique distributions by name.
You can’t perform that action at this time.
0 commit comments