From 08b8c88ac3ad5f44fcb8d29748480913252bb47b Mon Sep 17 00:00:00 2001 From: rmg-x Date: Thu, 5 Dec 2024 19:20:05 -0600 Subject: [PATCH] Tests/LibWeb: Use `Optional` instead of `| None` syntax in echo script The `str | None` syntax is only supported in Python 3.10+ and we can support more Python versions without compromising readability by importing the `Optional` type. --- Tests/LibWeb/Fixtures/http-test-server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/LibWeb/Fixtures/http-test-server.py b/Tests/LibWeb/Fixtures/http-test-server.py index 1e9b5a964a6..987e32c9305 100755 --- a/Tests/LibWeb/Fixtures/http-test-server.py +++ b/Tests/LibWeb/Fixtures/http-test-server.py @@ -6,7 +6,7 @@ import os import socketserver import sys import time -from typing import Dict +from typing import Dict, Optional """ Description: @@ -22,9 +22,9 @@ class Echo: method: str path: str status: int - headers: Dict[str, str] | None - body: str | None - delay_ms: int | None + headers: Optional[Dict[str, str]] + body: Optional[str] + delay_ms: Optional[str] # In-memory store for echo responses