Skip to content

Commit 4a161cd

Browse files
committed
Address PR comments
1 parent 3f83750 commit 4a161cd

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

newsfragments/4505.feature.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Changed the order of type checks in ``setuptools.command.easy_install.CommandSpec.from_param`` to support any `collections.abc.Iterable` of `str` param and to always fallback to the environment if the param type is unsupported -- by :user:`Avasam`
1+
Changed the order of type checks in ``setuptools.command.easy_install.CommandSpec.from_param`` to support any `collections.abc.Iterable` of `str` param -- by :user:`Avasam`

setuptools/command/easy_install.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,7 +2070,10 @@ def from_param(cls, param: Self | str | Iterable[str] | None) -> Self:
20702070
return cls.from_string(param)
20712071
if isinstance(param, Iterable):
20722072
return cls(param)
2073-
return cls.from_environment()
2073+
if param is None:
2074+
return cls.from_environment()
2075+
# AttributeError to keep backwards compatibility, this should really be a TypeError though
2076+
raise AttributeError(f"Argument has an unsupported type {type(param)}")
20742077

20752078
@classmethod
20762079
def from_environment(cls):

setuptools/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class Extension(_Extension):
128128
"""
129129

130130
def __init__(
131-
self, name: str, sources: list[str], *args, py_limited_api: bool = False, **kw
131+
self, name: str, sources, *args, py_limited_api: bool = False, **kw
132132
):
133133
# The *args is needed for compatibility as calls may use positional
134134
# arguments. py_limited_api may be set only via keyword.

0 commit comments

Comments
 (0)