Skip to content

Commit

Permalink
chore: cleanup Semaphore repr (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Dec 19, 2024
1 parent 8bdf8ea commit c9596f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion a_sync/primitives/locks/semaphore.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c9596f7

Please sign in to comment.