From 6b6e330ed1c44973409ab7e3a0c11c63e587cca7 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Tue, 21 Jan 2025 09:22:36 -0500 Subject: [PATCH 1/2] Pass along verbose option at exit connection --- h2o-py/h2o/backend/connection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/h2o-py/h2o/backend/connection.py b/h2o-py/h2o/backend/connection.py index bc99c25f5b93..f8d0b83785f0 100644 --- a/h2o-py/h2o/backend/connection.py +++ b/h2o-py/h2o/backend/connection.py @@ -413,13 +413,14 @@ def open(server=None, url=None, ip=None, port=None, name=None, https=None, auth= conn_ref = ref(conn) apply_session_hooks('open') - def exit_close(): + def exit_close(verbose=True): con = conn_ref() if con and con.connected: - print("Closing connection %s at exit" % con.session_id) + if verbose: + print("Closing connection %s at exit" % con.session_id) con.close() - atexit.register(exit_close) + atexit.register(exit_close, verbose=self.verbose) except Exception: # Reset _session_id so that we know the connection was not initialized properly. conn._stage = 0 From aaa22db85c72eef6207cf3584a41e8a70ac65ed9 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Tue, 21 Jan 2025 09:33:21 -0500 Subject: [PATCH 2/2] fix wrong variable --- h2o-py/h2o/backend/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h2o-py/h2o/backend/connection.py b/h2o-py/h2o/backend/connection.py index f8d0b83785f0..580761f94a88 100644 --- a/h2o-py/h2o/backend/connection.py +++ b/h2o-py/h2o/backend/connection.py @@ -420,7 +420,7 @@ def exit_close(verbose=True): print("Closing connection %s at exit" % con.session_id) con.close() - atexit.register(exit_close, verbose=self.verbose) + atexit.register(exit_close, verbose=verbose) except Exception: # Reset _session_id so that we know the connection was not initialized properly. conn._stage = 0