Skip to content

Commit

Permalink
revert getattr changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgromero committed Nov 15, 2024
1 parent ce7511a commit b8f4f0d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions botocore/endpoint_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
logger = logging.getLogger(__name__)

TEMPLATE_STRING_RE = re.compile(r"\{[a-zA-Z#]+\}")
GET_ATTR_RE = re.compile(r"(\w*)\[(\d+)\]")
GET_ATTR_RE = re.compile(r"(\w+)\[(\d+)\]")
VALID_HOST_LABEL_RE = re.compile(
r"^(?!-)[a-zA-Z\d-]{1,63}(?<!-)$",
)
Expand Down Expand Up @@ -178,8 +178,7 @@ def get_attr(self, value, path):
if match is not None:
name, index = match.groups()
index = int(index)
if name:
value = value.get(name)
value = value.get(name)
if value is None or index >= len(value):
return None
return value[index]
Expand Down

0 comments on commit b8f4f0d

Please sign in to comment.