summaryrefslogtreecommitdiff
path: root/Lib/urllib/parse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r--Lib/urllib/parse.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py
index dfba704144..daefb2025b 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -979,17 +979,15 @@ def _to_bytes(url):
def unwrap(url):
- warnings.warn("urllib.parse.unwrap() is deprecated as of 3.8",
- DeprecationWarning, stacklevel=2)
- return _unwrap(url)
-
+ """Transform a string like '<URL:scheme://host/path>' into 'scheme://host/path'.
-def _unwrap(url):
- """unwrap('<URL:type://host/path>') --> 'type://host/path'."""
+ The string is returned unchanged if it's not a wrapped URL.
+ """
url = str(url).strip()
if url[:1] == '<' and url[-1:] == '>':
url = url[1:-1].strip()
- if url[:4] == 'URL:': url = url[4:].strip()
+ if url[:4] == 'URL:':
+ url = url[4:].strip()
return url