Commits

Tarek Ziadé committed 5b46982

using urlparse to extract the fragment

  • Participants
  • Parent commits bec2eb2
  • Branches 0.6-maintenance

Comments (0)

Files changed (1)

File pkg_resources.py

 """
 
 import sys, os, zipimport, time, re, imp, types
+from urlparse import urlparse, urlunparse
 
 try:
     frozenset
     parse_map = classmethod(parse_map)
 
 
-
-
+def _remove_md5_fragment(location):
+    if not location:
+        return ''
+    parsed = urlparse(location)
+    if 'md5' in parsed[-1]:
+        return urlunparse(parsed[:-1] + ('',))
+    return location
 
 
 class Distribution(object):
         )
     from_location = classmethod(from_location)
 
+
     hashcmp = property(
         lambda self: (
             getattr(self,'parsed_version',()),
             self.precedence,
             self.key,
-            (self.location or '').split('#md5=')[0],
+            _remove_md5_fragment(self.location),
             self.py_version,
             self.platform
         )