[pypy-svn] r76383 - pypy/benchmarks/own/twisted

fijal at codespeak.net fijal at codespeak.net
Wed Jul 28 11:51:40 CEST 2010


Author: fijal
Date: Wed Jul 28 11:51:38 2010
New Revision: 76383

Modified:
   pypy/benchmarks/own/twisted/benchlib.py
Log:
Make sure we read all the data from os.popen


Modified: pypy/benchmarks/own/twisted/benchlib.py
==============================================================================
--- pypy/benchmarks/own/twisted/benchlib.py	(original)
+++ pypy/benchmarks/own/twisted/benchlib.py	Wed Jul 28 11:51:38 2010
@@ -109,7 +109,14 @@
     import time, os
     for i in range(24):
         g = os.popen('netstat -atn')
-        data = g.read()
+        # make sure we read *all* data
+        all = []
+        while True:
+            data = g.read()
+            if not data:
+                break
+            all.append(data)
+        data = "".join(all)
         g.close()
         if ('Active Internet connections' in data and
             data.count('TIME_WAIT') < 20):



More information about the Pypy-commit mailing list