From 30c9d38bd7333299b1ce5d49fbe24684394b4a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 8 Jan 2016 17:47:36 +0100 Subject: Fix exception when writing to input pipe --- mcwrapper | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mcwrapper') diff --git a/mcwrapper b/mcwrapper index 9e137ae..fda83fa 100755 --- a/mcwrapper +++ b/mcwrapper @@ -199,10 +199,10 @@ class MCServer: return False def write_to_terminal(self, text): "Write to server terminal. If server not running it does nothing" - if self.statis == 2: - info(self.identifier + ": Input: " + ln, 1) - self.prc.write(bytes(line, sys.getdefaultencoding())) - self.prc.flush() + if self.status == 2: + info(self.identifier + ": Input: " + text, 1) + self.prc.stdin.write(bytes(text, sys.getdefaultencoding())) + self.prc.stdin.flush() return True else: return False -- cgit v1.2.3