Browse Source

[2855] Don't use clear() on lists (as it is a Python 3.3 feature)

Mukund Sivaraman 11 years ago
parent
commit
61dcb03fbe

+ 1 - 1
src/lib/python/isc/memmgr/builder.py

@@ -69,7 +69,7 @@ class MemorySegmentBuilder:
                 # Move the queue content to a local queue. Be careful of
                 # Move the queue content to a local queue. Be careful of
                 # not making assignments to reference variables.
                 # not making assignments to reference variables.
                 local_command_queue = self._command_queue.copy()
                 local_command_queue = self._command_queue.copy()
-                self._command_queue.clear()
+                del self._command_queue[:]
 
 
                 # Run commands passed in the command queue sequentially
                 # Run commands passed in the command queue sequentially
                 # in the given order.  For now, it only supports the
                 # in the given order.  For now, it only supports the

+ 1 - 1
src/lib/python/isc/memmgr/tests/builder_tests.py

@@ -86,7 +86,7 @@ class TestMemorySegmentBuilder(unittest.TestCase):
         response = self._builder_response_queue[0]
         response = self._builder_response_queue[0]
         self.assertTrue(isinstance(response, tuple))
         self.assertTrue(isinstance(response, tuple))
         self.assertTupleEqual(response, ('bad_command',))
         self.assertTupleEqual(response, ('bad_command',))
-        self._builder_response_queue.clear()
+        del self._builder_response_queue[:]
 
 
     def test_shutdown(self):
     def test_shutdown(self):
         """Tests that shutdown command exits the MemorySegmentBuilder
         """Tests that shutdown command exits the MemorySegmentBuilder