diff options
| author | Hanno Schlichting <hanno@hannosch.eu> | 2009-07-17 17:32:19 +0200 |
|---|---|---|
| committer | Hanno Schlichting <hanno@hannosch.eu> | 2009-07-17 17:32:19 +0200 |
| commit | e7b68f2b4824ac95ccd7b1e0c2b050818b0f75b2 (patch) | |
| tree | b6829450939a0aa7b55e352ee8dc6277f25185c9 /pkg_resources.py | |
| parent | a239dfea9549314e200d91f65ab50c0009359a56 (diff) | |
| download | python-setuptools-git-e7b68f2b4824ac95ccd7b1e0c2b050818b0f75b2.tar.gz | |
Avoid a call to /usr/bin/sw_vers on OSX and use the official platform API instead. Based on a patch from ronaldoussoren. This closes #5.
--HG--
branch : distribute
extra : rebase_source : a608bd596af3fab7caaed024b5699341ba8d9a5a
Diffstat (limited to 'pkg_resources.py')
| -rw-r--r-- | pkg_resources.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index fe257754..9ec094a1 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -166,14 +166,9 @@ def get_provider(moduleOrReq): def _macosx_vers(_cache=[]): if not _cache: - info = os.popen('/usr/bin/sw_vers').read().splitlines() - for line in info: - key, value = line.split(None, 1) - if key == 'ProductVersion:': - _cache.append(value.strip().split(".")) - break - else: - raise ValueError, "What?!" + import platform + version = platform.mac_ver()[0] + _cache.append(version.split('.')) return _cache[0] def _macosx_arch(machine): |
