Skip to content

Commit 4505168

Browse files
committed
update
1 parent 73448d7 commit 4505168

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

integration_tests/base_routes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import pathlib
34
from collections import defaultdict
45
from typing import Optional, List
@@ -559,9 +560,16 @@ async def async_dict_post():
559560

560561
# Body
561562

563+
if sys.version_info >= (3, 9):
564+
# Python 3.9+ syntax
565+
from typing import list as ListType
566+
else:
567+
# Python 3.8 compatible syntax
568+
ListType = List
569+
562570
class TestMyRequest(Body):
563571
items: List[str]
564-
numbers: list[int]
572+
numbers: ListType[int]
565573

566574

567575
@app.post("/sync/body")

0 commit comments

Comments
 (0)