From c9596f7e3df425fbac2c24a91f00eabf137ea406 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:34:17 -0400 Subject: [PATCH] chore: cleanup Semaphore repr (#501) --- a_sync/primitives/locks/semaphore.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/a_sync/primitives/locks/semaphore.pyx b/a_sync/primitives/locks/semaphore.pyx index 5c02ab12..288bcdae 100644 --- a/a_sync/primitives/locks/semaphore.pyx +++ b/a_sync/primitives/locks/semaphore.pyx @@ -118,7 +118,8 @@ cdef class Semaphore(_DebugDaemonMixin): def __repr__(self) -> str: representation = f"<{self.__class__.__name__} name={self.decode_name()} value={self._Semaphore__value} waiters={len(self)}>" if self._decorated: - representation = f"{representation[:-1]} decorates={self._decorated}" + detail = next(iter(decorated)) if len(decorated := self._decorated) == 1 else decorated + representation = f"{representation[:-1]} decorates={detail}" return representation async def __aenter__(self):