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 d06884758cb64b0226a0811fda273ff41f35ae51
parent 432422 b817f99334fa42aa949d0c2da4a76bafb881dd4d
child 432424 bd809f9f27e00566e114900b6d057f87733b352a
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)
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
--- 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)
-            response = Response.from_http_response(conn.getresponse())
+            response = conn.getresponse()
+            return Response.from_http_response(response)
-        return response