diff --git a/h2o-py/h2o/backend/connection.py b/h2o-py/h2o/backend/connection.py index bc99c25f5b93..580761f94a88 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=verbose) except Exception: # Reset _session_id so that we know the connection was not initialized properly. conn._stage = 0