Skip to content

Commit

Permalink
REFACTOR: fn rendering in wait for DRY
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaka committed May 29, 2024
1 parent 6453d4e commit 045cd66
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions selene/core/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,7 @@ def logic(fn: Callable[[E], R]) -> R:
timeout = self._timeout
entity = self.entity

# if it's a normal function, it should have __qualname__,
# then use it, otherwise use str(fn)
fn_name = getattr(
fn,
'__qualname__',
getattr(fn, '__str__', lambda: str(fn))(),
)
fn_name = Query.full_name_for(fn) or str(fn)

failure = TimeoutException(
f'\n'
Expand Down

0 comments on commit 045cd66

Please sign in to comment.