mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
ruff: Fix UP007 Use X | Y for type annotations.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
e08a24e47f
commit
531b34cb4c
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
from datetime import datetime, timezone
|
||||
from typing import Any, Optional
|
||||
from typing import Any
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from django.http import HttpRequest, HttpResponse
|
||||
@@ -90,7 +90,7 @@ def is_sample_event(event: dict[str, Any]) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def convert_lines_to_traceback_string(lines: Optional[list[str]]) -> str:
|
||||
def convert_lines_to_traceback_string(lines: list[str] | None) -> str:
|
||||
traceback = ""
|
||||
if lines is not None:
|
||||
for line in lines:
|
||||
@@ -243,7 +243,7 @@ def handle_deprecated_payload(payload: dict[str, Any]) -> tuple[str, str]:
|
||||
return (topic_name, body)
|
||||
|
||||
|
||||
def transform_webhook_payload(payload: dict[str, Any]) -> Optional[dict[str, Any]]:
|
||||
def transform_webhook_payload(payload: dict[str, Any]) -> dict[str, Any] | None:
|
||||
"""Attempt to use webhook payload for the notification.
|
||||
|
||||
When the integration is configured as a webhook, instead of being added as
|
||||
|
||||
Reference in New Issue
Block a user