Bug 1405325 - Assign actual response to variable. r=maja_zf
authorAndreas Tolfsen <ato@sny.no>
Tue, 03 Oct 2017 16:23:24 +0100
changeset 432423 d06884758cb6
parent 432422 b817f99334fa
child 432424 bd809f9f27e0
push id7953
push userryanvm@gmail.com
push dateThu, 12 Oct 2017 14:05:58 +0000
treeherdermozilla-beta@f4ba99b41183 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1405325
milestone57.0
Bug 1405325 - Assign actual response to variable. r=maja_zf This is a non-functional change, but if anything should be assigned to the "response" value, it should be the actual response. I had to do this because I was debugging a low-level HTTP problem with geckodriver, so this will be more useful in the future. In any case, we can return the webdriver.transport.Response representation directly because the finally clause is always called. MozReview-Commit-ID: 8JKNKAEbOAe
testing/web-platform/tests/tools/webdriver/webdriver/transport.py
--- a/testing/web-platform/tests/tools/webdriver/webdriver/transport.py
+++ b/testing/web-platform/tests/tools/webdriver/webdriver/transport.py
@@ -95,13 +95,12 @@ class HTTPWireProtocol(object):
         if self._timeout is not None:
             kwargs["timeout"] = self._timeout
 
         conn = httplib.HTTPConnection(
             self.host, self.port, strict=True, **kwargs)
         conn.request(method, url, body, headers)
 
         try:
-            response = Response.from_http_response(conn.getresponse())
+            response = conn.getresponse()
+            return Response.from_http_response(response)
         finally:
             conn.close()
-
-        return response