Bug 1017022 - Call close() on a valid object. r=jgriffin, a=test-only
authorMalini Das <mdas@mozilla.com>
Mon, 02 Jun 2014 11:01:28 -0400
changeset 200458 2d80998069cdf01d435afea2fbc656f3e0441773
parent 200457 8182fa6b12e23fa254ca49a09e4e613a1b368fed
child 200459 1cf1228b843300d17cf375d9ceda472095fad023
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin, test-only
bugs1017022
milestone31.0a2
Bug 1017022 - Call close() on a valid object. r=jgriffin, a=test-only
testing/marionette/transport/marionette_transport/transport.py
--- a/testing/marionette/transport/marionette_transport/transport.py
+++ b/testing/marionette/transport/marionette_transport/transport.py
@@ -96,10 +96,11 @@ class MarionetteTransport(object):
                     raise e
 
         response = self.receive()
         return response
 
     def close(self):
         """ Close the socket.
         """
-        self.sock.close()
+        if self.sock:
+            self.sock.close()
         self.sock = None