fix: when msg_fd is 0, use STDOUT_FILENO

This commit is contained in:
Ryo Nakamura
2023-03-15 01:35:55 +09:00
parent 4e80b05da7
commit 24fef5f539
3 changed files with 7 additions and 0 deletions

View File

@@ -71,6 +71,9 @@ class mscp:
self.state = STATE_INIT
def __str__(self):
if not hasattr(self, "state"):
# this instance failed on mscp_init
return "mscp:{}:init-failed"
return "mscp:{}:{}".format(self.remote, self.__state2str())
def __repr__(self):