|
5 | 5 | from __future__ import annotations |
6 | 6 |
|
7 | 7 | import json |
8 | | -from re import compile |
| 8 | +import re |
9 | 9 | from typing import ( |
10 | 10 | TYPE_CHECKING, |
11 | 11 | Any, |
@@ -74,7 +74,7 @@ def integer_range_checker(x: Any) -> Union[str, bytes, SupportsInt, SupportsInde |
74 | 74 |
|
75 | 75 |
|
76 | 76 | def integer_list_item( |
77 | | - allowed_values: List[float], |
| 77 | + allowed_values: List[int], |
78 | 78 | ) -> Callable[[Any], Union[str, bytes, SupportsInt, SupportsIndex]]: |
79 | 79 | def integer_list_item_checker( |
80 | 80 | x: Any, |
@@ -140,19 +140,19 @@ def s3_bucket_name(b: str) -> str: |
140 | 140 |
|
141 | 141 | # IP addresses not allowed |
142 | 142 |
|
143 | | - ip_re = compile(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$") |
| 143 | + ip_re = re.compile(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$") |
144 | 144 | if ip_re.match(b): |
145 | 145 | raise ValueError("%s is not a valid s3 bucket name" % b) |
146 | 146 |
|
147 | | - s3_bucket_name_re = compile(r"^[a-z\d][a-z\d\.-]{1,61}[a-z\d]$") |
| 147 | + s3_bucket_name_re = re.compile(r"^[a-z\d][a-z\d\.-]{1,61}[a-z\d]$") |
148 | 148 | if s3_bucket_name_re.match(b): |
149 | 149 | return b |
150 | 150 | else: |
151 | 151 | raise ValueError("%s is not a valid s3 bucket name" % b) |
152 | 152 |
|
153 | 153 |
|
154 | 154 | def elb_name(b: str) -> str: |
155 | | - elb_name_re = compile( |
| 155 | + elb_name_re = re.compile( |
156 | 156 | r"^[a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,30}[a-zA-Z0-9]{1})?$" |
157 | 157 | ) # noqa |
158 | 158 | if elb_name_re.match(b): |
|
0 commit comments