[Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py (original) (raw)
Guido van Rossum guido at python.org
Thu Sep 22 17:31:36 CEST 2005
- Previous message: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py
- Next message: [Python-Dev] bool(iter([])) changed between 2.3 and 2.4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thanks all! I won't touch it. /usr/bin/sw_vers is the way to go.
On 9/22/05, M.-A. Lemburg <mal at egenix.com> wrote:
Ronald Oussoren wrote: > > On 22-sep-2005, at 5:26, Guido van Rossum wrote: > >> The platform module has a way to map system names such as returned by >> uname() to marketing names. It maps SunOS to Solaris, for example. But >> it doesn't map Darwin to Mac OS X. I think I know how to map Darwin >> version numbers to OS X version numbers: from >> http://www.opensource.apple.com/darwinsource/ it is clear that OS X >> 10.a.b corresponds to Darwin (a+4).b, except for OS X versions <=_ _>> 10.1. I'd be happy to write the code and add it to systemalias() in >> platform.py. Is this a good idea? > > > There's no good reason to assume that the mapping from kernel version > to marketing version will stay the same in the future. The savest way > to get the marketing version of the currently running OSX is to run / > usr/sbin/swvers and parse its output. There might also be a public API > for getting the same information. Py2app, and specifically the > bdistmpkg component of that, contains code to parse swvers output.
I don't have access to Macs, so there nothing much I can say about this. In general, it's always better to rely on system tools for finding the marketing name of an OS than to try to come up with a work-around. If gestalt() returns the proper name, then this should be used. If swvers provides a more reliable way to do this, parsing its output seems like a better idea.
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] Mapping Darwin 8.2.0 to Mac OS X 10.4.2 in platform.py
- Next message: [Python-Dev] bool(iter([])) changed between 2.3 and 2.4
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]