Skip to content

Commit

Permalink
refactor(actor): Fix pylint unsubscriptable-object warning
Browse files Browse the repository at this point in the history
  • Loading branch information
gfieni committed May 14, 2024
1 parent 5235070 commit ab465d7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/powerapi/actor/socket_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,12 @@ def receive(self):
:return: the list of received messages or None if timeout
:rtype: a list of Object or None
"""
events = self.poller.poll(self.timeout)
events = dict(self.poller.poll(self.timeout))

# If there is data available on both sockets, the control one has priority
if len(events) == 2:
return self._recv_serialized(self.control_socket)

if len(events) == 1:
return self._recv_serialized(events[0][0])
if len(events) == 0:
return None

Check warning on line 160 in src/powerapi/actor/socket_interface.py

View check run for this annotation

Codecov / codecov/patch

src/powerapi/actor/socket_interface.py#L160

Added line #L160 was not covered by tests

return None
return self._recv_serialized(next(iter(events)))

def receive_control(self, timeout):
"""
Expand Down

0 comments on commit ab465d7

Please sign in to comment.