mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-02 18:51:31 +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)
|
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.
|
Format response data based on command.
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,6 @@ from gunicorn.ctl.protocol import (
|
|||||||
|
|
||||||
class ControlClientError(Exception):
|
class ControlClientError(Exception):
|
||||||
"""Control client error."""
|
"""Control client error."""
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class ControlClient:
|
class ControlClient:
|
||||||
|
|||||||
@ -210,7 +210,6 @@ class CommandHandlers:
|
|||||||
|
|
||||||
# Try to get socket family
|
# Try to get socket family
|
||||||
try:
|
try:
|
||||||
import socket
|
|
||||||
sock = lnr.sock
|
sock = lnr.sock
|
||||||
if sock.family == socket.AF_UNIX:
|
if sock.family == socket.AF_UNIX:
|
||||||
listener_info["type"] = "unix"
|
listener_info["type"] = "unix"
|
||||||
@ -523,8 +522,6 @@ class CommandHandlers:
|
|||||||
Returns:
|
Returns:
|
||||||
List of dirty worker info dicts, or empty list on error
|
List of dirty worker info dicts, or empty list on error
|
||||||
"""
|
"""
|
||||||
import socket
|
|
||||||
|
|
||||||
# Get socket path from arbiter object or environment
|
# Get socket path from arbiter object or environment
|
||||||
dirty_socket_path = None
|
dirty_socket_path = None
|
||||||
if hasattr(self.arbiter, 'dirty_arbiter') and self.arbiter.dirty_arbiter:
|
if hasattr(self.arbiter, 'dirty_arbiter') and self.arbiter.dirty_arbiter:
|
||||||
|
|||||||
@ -26,7 +26,6 @@ import struct
|
|||||||
|
|
||||||
class ProtocolError(Exception):
|
class ProtocolError(Exception):
|
||||||
"""Protocol-level error."""
|
"""Protocol-level error."""
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class ControlProtocol:
|
class ControlProtocol:
|
||||||
|
|||||||
@ -204,7 +204,7 @@ class ControlSocketServer:
|
|||||||
self.arbiter.log.exception("Command error")
|
self.arbiter.log.exception("Command error")
|
||||||
return make_error_response(request_id, f"Command failed: {e}")
|
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.
|
Execute a parsed command.
|
||||||
|
|
||||||
|
|||||||
@ -573,7 +573,7 @@ class BinaryProtocol:
|
|||||||
sock.sendall(data)
|
sock.sendall(data)
|
||||||
|
|
||||||
@staticmethod
|
@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.
|
Encode a message dict to binary format.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user