mailr23254 - /trunk/multi/uni_processor.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on May 20, 2014 - 13:37:
Author: bugman
Date: Tue May 20 13:37:32 2014
New Revision: 23254

URL: http://svn.gna.org/viewcvs/relax?rev=23254&view=rev
Log:
Fix for the chain-reaction failures in the test suite.

This fixes bug #22055 (https://gna.org/bugs/?22055), the 
processor.run_queue() not cleaning up in
uni_processor - chain-reaction failures in the test suite.

The fix was insanely simple, just implementing what was mentioned Gary's 
FIXME comment in the
run_queue() method of the uni-processor object.  The queue execution code has 
been placed inside a
'try' statement and the queue cleaning up code in a 'finally' statement.

This closes a painfully difficult to find bug that has been in relax since 
2006.


Modified:
    trunk/multi/uni_processor.py

Modified: trunk/multi/uni_processor.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/multi/uni_processor.py?rev=23254&r1=23253&r2=23254&view=diff
==============================================================================
--- trunk/multi/uni_processor.py        (original)
+++ trunk/multi/uni_processor.py        Tue May 20 13:37:32 2014
@@ -175,15 +175,18 @@
 
 
     def run_queue(self):
-        #FIXME: need a finally here to cleanup exceptions states for windows 
etc
+        """Safely run each command in the queue, cleaning up after 
failures."""
 
-        last_command = len(self.command_queue)-1
-        for i, command  in enumerate(self.command_queue):
-            completed = (i == last_command)
+        # Run each command in the queue.
+        try:
+            last_command = len(self.command_queue)-1
+            for i, command  in enumerate(self.command_queue):
+                completed = (i == last_command)
 
-            command.run(self, completed)
+                command.run(self, completed)
 
-        #self.run_command_queue()
-        #TODO: add cheques for empty queues and maps if now warn
-        del self.command_queue[:]
-        self.memo_map.clear()
+        # Clear the queue, even if a failure occurs.
+        finally:
+            #TODO: add cheques for empty queues and maps if now warn
+            del self.command_queue[:]
+            self.memo_map.clear()




Related Messages


Powered by MHonArc, Updated Tue May 20 13:40:02 2014