Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
mhidalgo-bdai committed Aug 12, 2024
1 parent f548579 commit 2a8805b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bdai_ros2_wrappers/bdai_ros2_wrappers/callables.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def __get__(
) -> Union["GeneralizedMethodLike[P]", "P"]:
if instance is None:
return self
return cast(P, getattr(instance, self.__attribute_name))
return cast(P, super().__get__(instance, owner))


@overload
Expand Down Expand Up @@ -483,11 +483,18 @@ def generalized_method(
transitional: a transitional method will stick to its
prototype for default invocations.
"""
if spec is not None:

def __decorator(func: Callable) -> GeneralizedMethodLike[P]:
if spec is not None:
def __decorator_with_spec(func: Callable) -> GeneralizedMethodLike[P]:
assert spec is not None
return spec(func, transitional)
return GeneralizedMethodLike[P](func, transitional)

if func is None:
return __decorator_with_spec
return __decorator_with_spec(func)

def __decorator(func: Callable) -> GeneralizedMethod:
return GeneralizedMethod(func, transitional)

if func is None:
return __decorator
Expand Down

0 comments on commit 2a8805b

Please sign in to comment.