chiark / gitweb /
fishdescriptor: debugging
[chiark-utils.git] / fishdescriptor / py / fishdescriptor / fish.py
index 9c7fca839e44ae5c3c923952ee5019be1617d2f2..4739feb845e4e7ad4b5a507eb5161fe953d33779 100644 (file)
@@ -24,11 +24,11 @@ class Donor():
         )            
 
     def _eval_integer(d, expr):
-        l = d._sp.stdin.readline()
-        if l != '!\n': raise RuntimeError("indonor said %s" % repr(l))
-        d._sp.stdout.write(expr + '\n')
-        d._sp.stdout.flush()
-        l = d._sp.stdin.readline().rstrip('\n')
+        l = d._sp.stdout.readline()
+        if l != b'!\n': raise RuntimeError("indonor said %s" % repr(l))
+        d._sp.stdin.write(expr.encode('utf-8') + b'\n')
+        d._sp.stdin.flush()
+        l = d._sp.stdout.readline().rstrip(b'\n')
         return int(l)
 
     def _eval_success(d, expr):