Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Aug 8, 2024
1 parent 3f83750 commit 4a161cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion newsfragments/4505.feature.rst
Original file line number Diff line number Diff line change
@@ -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`
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`
5 changes: 4 additions & 1 deletion setuptools/command/easy_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,10 @@ def from_param(cls, param: Self | str | Iterable[str] | None) -> Self:
return cls.from_string(param)
if isinstance(param, Iterable):
return cls(param)
return cls.from_environment()
if param is None:
return cls.from_environment()
# AttributeError to keep backwards compatibility, this should really be a TypeError though
raise AttributeError(f"Argument has an unsupported type {type(param)}")

@classmethod
def from_environment(cls):
Expand Down
2 changes: 1 addition & 1 deletion setuptools/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class Extension(_Extension):
"""

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

0 comments on commit 4a161cd

Please sign in to comment.