From 1e8210498685d243331ffca5c15e8f532ac9e92c Mon Sep 17 00:00:00 2001
From: Luke Campagnola <luke.campagnola@gmail.com>
Date: Sat, 16 Nov 2013 21:51:55 -0500
Subject: [PATCH] Fixed running `python examples --test` for python3; needs to
 be tested under windows.

---
 examples/__main__.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/__main__.py b/examples/__main__.py
index 4aa23e8e..a397cf05 100644
--- a/examples/__main__.py
+++ b/examples/__main__.py
@@ -252,6 +252,7 @@ except:
     else:
         process = subprocess.Popen(['exec %s -i' % (exe)], shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
         process.stdin.write(code.encode('UTF-8'))
+        process.stdin.close() ##?
     output = ''
     fail = False
     while True:
@@ -266,8 +267,8 @@ except:
             break
     time.sleep(1)
     process.kill()
-    #process.wait()
-    res = process.communicate()
+    #res = process.communicate()
+    res = (process.stdout.read(), process.stderr.read())
     
     if fail or 'exception' in res[1].decode().lower() or 'error' in res[1].decode().lower():
         print('.' * (50-len(name)) + 'FAILED')
-- 
GitLab