This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-python.git

commit 945a8372b4189f07a2372e3e5e84bb2637a96a36
Author: Jiri Daněk <jda...@redhat.com>
AuthorDate: Sun Apr 16 18:07:09 2023 +0200

    QPID-8631: remember exception to raise, due to changed py3 exception object 
lifetime
---
 qpid/util.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qpid/util.py b/qpid/util.py
index b91005a..fd5c26d 100644
--- a/qpid/util.py
+++ b/qpid/util.py
@@ -79,9 +79,10 @@ def connect(host, port):
       break
     except socket.error as msg:
       sock.close()
+      last_msg = msg  # 
https://portingguide.readthedocs.io/en/latest/exceptions.html#caught-exception-scope
   else:
     # If we got here then we couldn't connect (yet)
-    raise
+    raise last_msg
   return sock
 
 def listen(host, port, predicate = lambda: True, bound = lambda: None):


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to