Fixed FURB118 (reimplemented-operator)

이 커밋은 다음에 포함됨:
Teal Dulcet
2025-06-18 04:17:27 -07:00
부모 c64a24e870
커밋 68fd3dc535
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
+2 -1
파일 보기
@@ -14,6 +14,7 @@ import rtyaml
from exclusiveprocess import Lock
from utils import load_environment, shell, wait_for_service
import operator
def backup_status(env):
# If backups are disabled, return no status.
@@ -91,7 +92,7 @@ def backup_status(env):
# Ensure the rows are sorted reverse chronologically.
# This is relied on by should_force_full() and the next step.
backups = sorted(backups.values(), key = lambda b : b["date"], reverse=True)
backups = sorted(backups.values(), key = operator.itemgetter("date"), reverse=True)
# Get the average size of incremental backups, the size of the
# most recent full backup, and the date of the most recent
+2 -1
파일 보기
@@ -15,6 +15,7 @@ import subprocess
import utils
from email_validator import validate_email as validate_email_, EmailNotValidError
import idna
import operator
def validate_email(email, mode=None):
# Checks that an email address is syntactically valid. Returns True/False.
@@ -285,7 +286,7 @@ def get_mail_aliases_ex(env):
# Sort aliases within each domain first by required-ness then lexicographically by address.
for domain in domains:
domain["aliases"].sort(key = lambda alias : (alias["auto"], alias["address"]))
domain["aliases"].sort(key = operator.itemgetter("auto", "address"))
return domains
def get_domain(emailaddr, as_unicode=True):