From ec528433a2f47e640a6e5a3c061c522511140d27 Mon Sep 17 00:00:00 2001 From: Tobias Nusser Date: Wed, 17 Apr 2024 12:48:26 +0200 Subject: [PATCH] Update sock.py by making bind list creation more readable Implementing suggestion by reviewer https://github.com/benoitc/gunicorn/pull/3127#discussion_r1568620243 to make code more readable. --- gunicorn/sock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gunicorn/sock.py b/gunicorn/sock.py index 8d5e60850..a89b68f3a 100644 --- a/gunicorn/sock.py +++ b/gunicorn/sock.py @@ -87,7 +87,8 @@ def create_sockets(conf, log, fds=None): # first initialization of gunicorn old_umask = os.umask(conf.umask) try: - for addr in [bind for bind in conf.address if not isinstance(bind, int)]: + bind_list = [bind for bind in conf.address if not isinstance(bind, int)] + for addr in bind_list: sock = create_socket(conf, log, addr) set_socket_options(conf, sock) listeners.append(sock)