Skip to content

Commit

Permalink
Fix --print_config failing in some cases (#517).
Browse files Browse the repository at this point in the history
  • Loading branch information
mauvilsa authored Jun 10, 2024
1 parent e361d8f commit 61ac055
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Fixed
- Parsing incorrectly provides file content when type is a union with a
subclass, PathLike and string (`#516
<https://github.com/omni-us/jsonargparse/issues/516>`__).
- ``--print_config`` failing in some cases (`#517
<https://github.com/omni-us/jsonargparse/issues/517>`__).


v4.29.0 (2024-05-24)
Expand Down
2 changes: 1 addition & 1 deletion jsonargparse/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def get_unaliased_type(cls):
def is_dataclass_like(cls) -> bool:
if is_generic_class(cls):
return is_dataclass_like(cls.__origin__)
if not inspect.isclass(cls):
if not inspect.isclass(cls) or cls is object:
return False
if is_final_class(cls):
return True
Expand Down
2 changes: 1 addition & 1 deletion jsonargparse/_parameter_resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def is_classmethod(parent, component) -> bool:


def is_lambda(value: Any) -> bool:
return callable(value) and value.__name__ == "<lambda>"
return callable(value) and getattr(value, "__name__", "") == "<lambda>"


def ast_str(node):
Expand Down

0 comments on commit 61ac055

Please sign in to comment.