Bug 1405325 - Assign actual response to variable. r=maja_zf draft
authorAndreas Tolfsen <ato@sny.no>
Tue, 03 Oct 2017 16:23:24 +0100
changeset 677231 7bf7f8c0c8cb554c7c5aba0680168f2baa9775f6
parent 677230 0293877da491cffa836fae776a284936058e7692
child 677232 5739e361fabdb7aaae7e532ce83b59679b56da2c
push id83730
push userbmo:ato@sny.no
push dateTue, 10 Oct 2017 11:48:50 +0000
reviewersmaja_zf
bugs1405325
milestone58.0a1
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