Use urlparse.uses_relative instead of unofficial urlparse.non_hierarchical (which has been removed in the current CPython 2.7.x trunk).

This commit is contained in:
Bastian Kleineidam 2012-08-04 20:40:31 +02:00
parent b0e5c7fc59
commit 1c739aed81

View file

@ -309,8 +309,7 @@ def url_norm (url, encoding=None):
is_idn = url_fix_host(urlparts)
# query
urlparts[3] = url_parse_query(urlparts[3], encoding=encoding)
is_hierarchical = urlparts[0] not in urlparse.non_hierarchical
if is_hierarchical:
if urlparts[0] in urlparse.uses_relative:
# URL has a hierarchical path we should norm
if not urlparts[2]:
# Empty path is allowed if both query and fragment are also empty.