Commit 6a36f2af authored by PJ Eby's avatar PJ Eby

Correctly handle URL fragments in --find-links.

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041241
parent f3925015
...@@ -44,6 +44,7 @@ def distros_for_url(url, metadata=None): ...@@ -44,6 +44,7 @@ def distros_for_url(url, metadata=None):
scheme, server, path, parameters, query, fragment = urlparse.urlparse(url) scheme, server, path, parameters, query, fragment = urlparse.urlparse(url)
base = urllib2.unquote(path.split('/')[-1]) base = urllib2.unquote(path.split('/')[-1])
if '#' in base: base, fragment = base.split('#',1)
dists = distros_for_location(url, base, metadata) dists = distros_for_location(url, base, metadata)
if fragment and not dists: if fragment and not dists:
match = EGG_FRAGMENT.match(fragment) match = EGG_FRAGMENT.match(fragment)
...@@ -79,7 +80,6 @@ def distros_for_location(location, basename, metadata=None): ...@@ -79,7 +80,6 @@ def distros_for_location(location, basename, metadata=None):
return [] # no extension matched return [] # no extension matched
def distros_for_filename(filename, metadata=None): def distros_for_filename(filename, metadata=None):
"""Yield possible egg or source distribution objects based on a filename""" """Yield possible egg or source distribution objects based on a filename"""
return distros_for_location( return distros_for_location(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment