Skip to content

Commit

Permalink
return empty list instead of None on restart
Browse files Browse the repository at this point in the history
This makes the type system a bit nicer.

ref 9f671a1
  • Loading branch information
Tony Crisci committed May 9, 2019
1 parent 3b5e210 commit cf55812
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions i3ipc/i3ipc.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,14 +504,13 @@ def command(self, payload):
``i3-msg`` or an ``exec`` block in your i3 config to control the
window manager.
:rtype: List of :class:`CommandReply` or None if the command causes i3
to restart or exit and does not give a reply.
:rtype: List of :class:`CommandReply`.
"""
data = self.message(MessageType.COMMAND, payload)
if data:
return json.loads(data, object_hook=CommandReply)
else:
return None
return []

def get_version(self):
"""
Expand Down

0 comments on commit cf55812

Please sign in to comment.