From d4d501aaa40d4a4e576238c933eb3446e037e339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Hork=C3=BD?= Date: Mon, 1 Feb 2021 22:08:21 +0100 Subject: [PATCH 1/4] Fix compatibility with the uWSGI preforking mode (issue #473) --- bravado/fido_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bravado/fido_client.py b/bravado/fido_client.py index 6c6e4687..77c631b0 100644 --- a/bravado/fido_client.py +++ b/bravado/fido_client.py @@ -7,7 +7,7 @@ import requests.structures import six import twisted.internet.error -import twisted.web.client +from twisted.web._newclient import RequestNotSent import typing from bravado_core.operation import Operation from bravado_core.response import IncomingResponse @@ -104,7 +104,7 @@ class FidoFutureAdapter(FutureAdapter[T]): fido.exceptions.TCPConnectionError, twisted.internet.error.ConnectingCancelledError, twisted.internet.error.DNSLookupError, - twisted.web.client.RequestNotSent, + RequestNotSent, ) def __init__(self, eventual_result): From a648e73f84ebe51a75f82ea4dc78f22330d86ebe Mon Sep 17 00:00:00 2001 From: JiriHorky Date: Tue, 2 Feb 2021 18:13:28 +0100 Subject: [PATCH 2/4] Make the order of imports more pretty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And hopefully make the automatic tests happy too. Co-authored-by: Lukáš Marek --- bravado/fido_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bravado/fido_client.py b/bravado/fido_client.py index 77c631b0..a70eaf98 100644 --- a/bravado/fido_client.py +++ b/bravado/fido_client.py @@ -11,6 +11,7 @@ import typing from bravado_core.operation import Operation from bravado_core.response import IncomingResponse +from twisted.web._newclient import RequestNotSent from yelp_bytes import to_bytes from bravado._equality_util import are_objects_equal as _are_objects_equal From 6bba319f93b9e684effdbcaaea6020e1e4367bf1 Mon Sep 17 00:00:00 2001 From: JiriHorky Date: Tue, 2 Feb 2021 18:15:46 +0100 Subject: [PATCH 3/4] Apply suggestions from code review (make order of imports more pretty) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And also hopefully make the automatic tests happy Co-authored-by: Lukáš Marek --- bravado/fido_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bravado/fido_client.py b/bravado/fido_client.py index a70eaf98..57e12893 100644 --- a/bravado/fido_client.py +++ b/bravado/fido_client.py @@ -7,11 +7,11 @@ import requests.structures import six import twisted.internet.error -from twisted.web._newclient import RequestNotSent import typing from bravado_core.operation import Operation from bravado_core.response import IncomingResponse from twisted.web._newclient import RequestNotSent +from twisted.web._newclient import RequestNotSent from yelp_bytes import to_bytes from bravado._equality_util import are_objects_equal as _are_objects_equal From 4dd880d769dc9317debfa02efc334e54f25d6d92 Mon Sep 17 00:00:00 2001 From: JiriHorky Date: Tue, 2 Feb 2021 18:18:34 +0100 Subject: [PATCH 4/4] Remove duplicate import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That got there by merging 2 similar suggestions. Co-authored-by: Lukáš Marek --- bravado/fido_client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/bravado/fido_client.py b/bravado/fido_client.py index 57e12893..4966435c 100644 --- a/bravado/fido_client.py +++ b/bravado/fido_client.py @@ -11,7 +11,6 @@ from bravado_core.operation import Operation from bravado_core.response import IncomingResponse from twisted.web._newclient import RequestNotSent -from twisted.web._newclient import RequestNotSent from yelp_bytes import to_bytes from bravado._equality_util import are_objects_equal as _are_objects_equal