mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
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.
This commit is contained in:
parent
e4bc6178b9
commit
08b8c88ac3
Notes:
github-actions[bot]
2024-12-06 06:10:46 +00:00
Author: https://github.com/rmg-x
Commit: 08b8c88ac3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2802
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@ import os
|
||||||
import socketserver
|
import socketserver
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from typing import Dict
|
from typing import Dict, Optional
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Description:
|
Description:
|
||||||
|
@ -22,9 +22,9 @@ class Echo:
|
||||||
method: str
|
method: str
|
||||||
path: str
|
path: str
|
||||||
status: int
|
status: int
|
||||||
headers: Dict[str, str] | None
|
headers: Optional[Dict[str, str]]
|
||||||
body: str | None
|
body: Optional[str]
|
||||||
delay_ms: int | None
|
delay_ms: Optional[str]
|
||||||
|
|
||||||
|
|
||||||
# In-memory store for echo responses
|
# In-memory store for echo responses
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue