Skip to content

Commit 19fb218

Browse files
committed
Refactor import statements in adapters.py
- Removed redundant import of `re` in `_has_ipv6_zone_id` function, as it is now imported at the top of the file. - Cleaned up code for better readability and maintainability.
1 parent 66025f7 commit 19fb218

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/requests/adapters.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"""
88

99
import os.path
10+
import re
1011
import socket # noqa: F401
1112
import typing
1213
import warnings
@@ -93,8 +94,6 @@ def _has_ipv6_zone_id(url: str) -> bool:
9394
# The % can be URL-encoded as %25 or literal %
9495
# Match brackets containing a % anywhere in the URL
9596
# This handles both literal % and %25 encoding
96-
import re
97-
9897
return bool(re.search(r"\[[^\]]*%(?:25)?[^\]]*\]", url))
9998

10099

0 commit comments

Comments
 (0)