diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2010-05-15 07:33:37 -1000 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2010-05-15 07:33:37 -1000 |
commit | 1fc291ffa0bdddb8869224a760f3af7ef5a45cf5 (patch) | |
tree | ca6c6b1e70f74b169bd6167d5c2aa81fbddb693d /pkg_resources.py | |
parent | 4353f3f6eaabc04859bcbd592c58df985bd2ad3b (diff) | |
parent | de6e3bcc3c77bff17a6609b31bc1b6a9212bbd88 (diff) | |
download | external_python_setuptools-1fc291ffa0bdddb8869224a760f3af7ef5a45cf5.tar.gz external_python_setuptools-1fc291ffa0bdddb8869224a760f3af7ef5a45cf5.tar.bz2 external_python_setuptools-1fc291ffa0bdddb8869224a760f3af7ef5a45cf5.zip |
Merged Fix for #151
--HG--
branch : distribute
extra : rebase_source : 7f7f9c64a26c6110096387b9862e06455c49f2ec
Diffstat (limited to 'pkg_resources.py')
-rw-r--r-- | pkg_resources.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index f31789e9..6ec51fa0 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -191,9 +191,10 @@ def _macosx_vers(_cache=[]): import plistlib plist = '/System/Library/CoreServices/SystemVersion.plist' if os.path.exists(plist): - plist_content = plistlib.readPlist(plist) - if 'ProductVersion' in plist_content: - version = plist_content['ProductVersion'] + if hasattr(plistlib, 'readPlist'): + plist_content = plistlib.readPlist(plist) + if 'ProductVersion' in plist_content: + version = plist_content['ProductVersion'] _cache.append(version.split('.')) return _cache[0] @@ -2332,7 +2333,8 @@ class Distribution(object): if modname in ('pkg_resources', 'setuptools', 'site'): continue fn = getattr(sys.modules[modname], '__file__', None) - if fn and normalize_path(fn).startswith(loc): + if fn and (normalize_path(fn).startswith(loc) or + fn.startswith(self.location)): continue issue_warning( "Module %s was already imported from %s, but %s is being added" |