Issue #3782: os.write() must not accept unicode strings
diff --git a/Lib/pty.py b/Lib/pty.py
index 4873827..810ebd8 100644
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -129,7 +129,7 @@
 
 def _writen(fd, data):
     """Write all the data to a descriptor."""
-    while data != '':
+    while data:
         n = os.write(fd, data)
         data = data[n:]