diff options
author | RĂ©mi Lapeyre <remi.lapeyre@henki.fr> | 2019-05-27 13:43:45 (GMT) |
---|---|---|
committer | Cheryl Sabella <cheryl.sabella@gmail.com> | 2019-05-27 13:43:45 (GMT) |
commit | 674ee1260025ff36f27e5d70ff6b66e3aab880bf (patch) | |
tree | 454d232beffc625bac7a51a9b2ae5e63818e774a /Lib/urllib/parse.py | |
parent | 1f39c28e489cca0397fc4c3675d13569318122ac (diff) | |
download | cpython-674ee1260025ff36f27e5d70ff6b66e3aab880bf.zip cpython-674ee1260025ff36f27e5d70ff6b66e3aab880bf.tar.gz cpython-674ee1260025ff36f27e5d70ff6b66e3aab880bf.tar.bz2 |
bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481)
Diffstat (limited to 'Lib/urllib/parse.py')
-rw-r--r-- | Lib/urllib/parse.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index dfba704..daefb20 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 |