Skip to content

Commit 6d81c9e

Browse files
committed
fix: resolve pylint warnings
1 parent 7486baa commit 6d81c9e

6 files changed

Lines changed: 3 additions & 8 deletions

File tree

gunicorn/ctl/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def format_all(data: dict) -> str:
230230
return "\n".join(lines)
231231

232232

233-
def format_response(command: str, data: dict) -> str:
233+
def format_response(command: str, data: dict) -> str: # pylint: disable=too-many-return-statements
234234
"""
235235
Format response data based on command.
236236

gunicorn/ctl/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
class ControlClientError(Exception):
2121
"""Control client error."""
22-
pass
2322

2423

2524
class ControlClient:

gunicorn/ctl/handlers.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ def show_listeners(self) -> dict:
210210

211211
# Try to get socket family
212212
try:
213-
import socket
214213
sock = lnr.sock
215214
if sock.family == socket.AF_UNIX:
216215
listener_info["type"] = "unix"
@@ -523,8 +522,6 @@ def _query_dirty_workers(self) -> list:
523522
Returns:
524523
List of dirty worker info dicts, or empty list on error
525524
"""
526-
import socket
527-
528525
# Get socket path from arbiter object or environment
529526
dirty_socket_path = None
530527
if hasattr(self.arbiter, 'dirty_arbiter') and self.arbiter.dirty_arbiter:

gunicorn/ctl/protocol.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
class ProtocolError(Exception):
2828
"""Protocol-level error."""
29-
pass
3029

3130

3231
class ControlProtocol:

gunicorn/ctl/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ async def _dispatch(self, message: dict) -> dict:
204204
self.arbiter.log.exception("Command error")
205205
return make_error_response(request_id, f"Command failed: {e}")
206206

207-
def _execute_command(self, parts: list) -> dict:
207+
def _execute_command(self, parts: list) -> dict: # pylint: disable=too-many-return-statements
208208
"""
209209
Execute a parsed command.
210210

gunicorn/dirty/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ def write_message(sock: socket.socket, message: dict) -> None:
573573
sock.sendall(data)
574574

575575
@staticmethod
576-
def _encode_from_dict(message: dict) -> bytes:
576+
def _encode_from_dict(message: dict) -> bytes: # pylint: disable=too-many-return-statements
577577
"""
578578
Encode a message dict to binary format.
579579

0 commit comments

Comments
 (0)