We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recently, at diamond we've been coming across an error that occasionally crops up and originates in the _ValueChecker:
_ValueChecker
class _ValueChecker(Generic[T]): def __init__(self, matcher: Callable[[T], bool], matcher_name: str): self._last_value: Optional[T] self._matcher = matcher self._matcher_name = matcher_name ... async def wait_for_value(self, signal: SignalR[T], timeout: float): try: await asyncio.wait_for(self._wait_for_value(signal), timeout) except asyncio.TimeoutError as e: raise TimeoutError( f"{signal.name} didn't match {self._matcher_name} in {timeout}s, " f"last value {self._last_value!r}" ) from e
we found the TimeoutError inconsistently raised AttributeError complaining that _ValueChecker doesn't have the attribute ._last_value.
TimeoutError
AttributeError
._last_value
To fix, the __init__ should look like:
__init__
class _ValueChecker(Generic[T]): def __init__(self, matcher: Callable[[T], bool], matcher_name: str): self._last_value: Optional[T] = None self._matcher = matcher self._matcher_name = matcher_name
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Recently, at diamond we've been coming across an error that occasionally crops up and originates in the
_ValueChecker
:we found the
TimeoutError
inconsistently raisedAttributeError
complaining that_ValueChecker
doesn't have the attribute._last_value
.To fix, the
__init__
should look like:The text was updated successfully, but these errors were encountered: