This is an automated email from the ASF dual-hosted git repository.
bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 7c1e8a2326 Python3.8: fix list type hints (#11097)
7c1e8a2326 is described below
commit 7c1e8a2326b6f188cf1953932f79117e986ca567
Author: Brian Neradt <[email protected]>
AuthorDate: Mon Feb 26 12:56:20 2024 -0600
Python3.8: fix list type hints (#11097)
The `list` type hint works for recent Python versions, but not for older
ones. This uses `typing.List` instead as that is backwards compatible.
---
tests/gold_tests/ip_allow/ip_category.test.py | 6 ++++--
tests/gold_tests/remap/remap_acl.test.py | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/gold_tests/ip_allow/ip_category.test.py
b/tests/gold_tests/ip_allow/ip_category.test.py
index 9c04df20d2..11e8f76d92 100644
--- a/tests/gold_tests/ip_allow/ip_category.test.py
+++ b/tests/gold_tests/ip_allow/ip_category.test.py
@@ -20,6 +20,8 @@ Verify IP allow ip_category behavior.
import os
import re
+from typing import List
+
Test.Summary = '''
Verify IP allow ip_category behavior.
'''
@@ -28,7 +30,7 @@ Verify IP allow ip_category behavior.
class CategoryFile:
"""Encapsulate the various ip_category.yaml contents."""
- contents: list['CategoryFile'] = []
+ contents: List['CategoryFile'] = []
parent_directory: str = Test.RunDirectory
_index: int = 0
@@ -126,7 +128,7 @@ class Test_ip_category:
def __init__(
self, name: str, replay_file: str, ip_allow_config: str,
ip_category_config: 'CategoryFile', acl_configuration: str,
- expected_responses: list[int]):
+ expected_responses: List[int]):
"""Initialize the test.
:param name: The name of the test.
diff --git a/tests/gold_tests/remap/remap_acl.test.py
b/tests/gold_tests/remap/remap_acl.test.py
index b4bb1c7e85..c65943b4b3 100644
--- a/tests/gold_tests/remap/remap_acl.test.py
+++ b/tests/gold_tests/remap/remap_acl.test.py
@@ -35,7 +35,7 @@ class Test_remap_acl:
def __init__(
self, name: str, replay_file: str, ip_allow_content: str,
deactivate_ip_allow: bool, acl_configuration: str,
- named_acls: List[Tuple[str, str]], expected_responses: list[int]):
+ named_acls: List[Tuple[str, str]], expected_responses: List[int]):
"""Initialize the test.
:param name: The name of the test.