mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 18:21:30 +08:00
fix: resolve pylint warnings
This commit is contained in:
parent
7486baa0ad
commit
6d81c9ebcd
@ -230,7 +230,7 @@ def format_all(data: dict) -> str:
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def format_response(command: str, data: dict) -> str:
|
||||
def format_response(command: str, data: dict) -> str: # pylint: disable=too-many-return-statements
|
||||
"""
|
||||
Format response data based on command.
|
||||
|
||||
|
||||
@ -19,7 +19,6 @@ from gunicorn.ctl.protocol import (
|
||||
|
||||
class ControlClientError(Exception):
|
||||
"""Control client error."""
|
||||
pass
|
||||
|
||||
|
||||
class ControlClient:
|
||||
|
||||
@ -210,7 +210,6 @@ class CommandHandlers:
|
||||
|
||||
# Try to get socket family
|
||||
try:
|
||||
import socket
|
||||
sock = lnr.sock
|
||||
if sock.family == socket.AF_UNIX:
|
||||
listener_info["type"] = "unix"
|
||||
@ -523,8 +522,6 @@ class CommandHandlers:
|
||||
Returns:
|
||||
List of dirty worker info dicts, or empty list on error
|
||||
"""
|
||||
import socket
|
||||
|
||||
# Get socket path from arbiter object or environment
|
||||
dirty_socket_path = None
|
||||
if hasattr(self.arbiter, 'dirty_arbiter') and self.arbiter.dirty_arbiter:
|
||||
|
||||
@ -26,7 +26,6 @@ import struct
|
||||
|
||||
class ProtocolError(Exception):
|
||||
"""Protocol-level error."""
|
||||
pass
|
||||
|
||||
|
||||
class ControlProtocol:
|
||||
|
||||
@ -204,7 +204,7 @@ class ControlSocketServer:
|
||||
self.arbiter.log.exception("Command error")
|
||||
return make_error_response(request_id, f"Command failed: {e}")
|
||||
|
||||
def _execute_command(self, parts: list) -> dict:
|
||||
def _execute_command(self, parts: list) -> dict: # pylint: disable=too-many-return-statements
|
||||
"""
|
||||
Execute a parsed command.
|
||||
|
||||
|
||||
@ -573,7 +573,7 @@ class BinaryProtocol:
|
||||
sock.sendall(data)
|
||||
|
||||
@staticmethod
|
||||
def _encode_from_dict(message: dict) -> bytes:
|
||||
def _encode_from_dict(message: dict) -> bytes: # pylint: disable=too-many-return-statements
|
||||
"""
|
||||
Encode a message dict to binary format.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user