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

Antoine Pitrou report at bugs.python.org
Thu Aug 18 20:12:25 CEST 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> > Then, let's just advise that all code follow the same path and use
> > sys.platform.startswith() (which is really not a difficult change to
> > make).
> 
> Antoine, please accept that people want better backwards compatibility
> than just recommendations how to rewrite applications.

You just said that "we" already had the same problem when Linux 2 was
released. So hopefully "people want better backwards compatibility"
would have learnt from that experience, and stopped hard-coding version
numbers.

Really, it's not difficult to understand that code testing for "linux2"
will stop working when "linux3" gets released. It's an obvious bug which
is also obvious to fix. Whether or not the Linux version numbering
scheme makes sense is a totally separate concern (which I agree may be
addressed by returning "linux" in 3.3).

----------

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


More information about the Python-bugs-list mailing list