[issue12326] Linux 3: code should avoid using sys.platform == 'linux2'

Marc-Andre Lemburg report at bugs.python.org
Fri Aug 19 15:35:27 CEST 2011


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Antoine Pitrou wrote:
> 
> Antoine Pitrou <pitrou at free.fr> added the comment:
> 
>> Please reread the quoted sentence:
>>
>> The *compile time* version information needs to be preserved.
> 
> Then please give it a very explicit name, such as "sys.build_platform"
> or "sys.compile_time_version_info". We don't want people to be misled by
> yet another platform identification attribute.

Good idea.

We could simply write `uname -s -r -m` into the new attribute:

sys.build_platform = ('Linux', '2.6.34.8-0.2-desktop', 'x86_64')

and then have

sys.platform = 'linux'

for quick general platform checks.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12326>
_______________________________________


More information about the Python-bugs-list mailing list