[asterisk-commits] russell: testsuite/asterisk/trunk r576 - in /asterisk/trunk: ./ lib/python/as...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jul 24 16:37:45 CDT 2010


Author: russell
Date: Sat Jul 24 16:37:41 2010
New Revision: 576

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=576
Log:
Catch exception when the pipe gets closed.

Modified:
    asterisk/trunk/lib/python/asterisk/asterisk.py
    asterisk/trunk/runtests.py

Modified: asterisk/trunk/lib/python/asterisk/asterisk.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/asterisk.py?view=diff&rev=576&r1=575&r2=576
==============================================================================
--- asterisk/trunk/lib/python/asterisk/asterisk.py (original)
+++ asterisk/trunk/lib/python/asterisk/asterisk.py Sat Jul 24 16:37:41 2010
@@ -184,9 +184,12 @@
 
         process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
         output = ""
-        for l in process.stdout.readlines():
-            print l,
-            output += l
+        try:
+            for l in process.stdout.readlines():
+                print l,
+                output += l
+        except IOError:
+            pass
         process.wait()
         return output
 

Modified: asterisk/trunk/runtests.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/runtests.py?view=diff&rev=576&r1=575&r2=576
==============================================================================
--- asterisk/trunk/runtests.py (original)
+++ asterisk/trunk/runtests.py Sat Jul 24 16:37:41 2010
@@ -147,9 +147,12 @@
                 print "FAILURE: Failed to open file for test output"
                 return
             p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
-            for l in p.stdout.readlines():
-                f.write(l)
-                print l,
+            try:
+                for l in p.stdout.readlines():
+                    f.write(l)
+                    print l,
+            except IOError:
+                pass
             p.wait()
             self.passed = p.returncode == 0
         else:




More information about the asterisk-commits mailing list