util/jsoncomm: simplify condition
This reduces `if fds && len(fds) > 0:` to `if fds:`. In python, empty collections are considered false, so the additional check is not needed.
This commit is contained in:
parent
2a9cdde5ec
commit
13c0dec8ee
1 changed files with 1 additions and 1 deletions
|
|
@ -299,7 +299,7 @@ class Socket(contextlib.AbstractContextManager):
|
|||
|
||||
serialized = json.dumps(payload).encode()
|
||||
cmsg = []
|
||||
if fds and len(fds) > 0:
|
||||
if fds:
|
||||
cmsg.append((socket.SOL_SOCKET, socket.SCM_RIGHTS, array.array("i", fds)))
|
||||
|
||||
n = self._socket.sendmsg([serialized], cmsg, 0, destination)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue