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

Antoine Pitrou report at bugs.python.org
Wed Jun 22 12:37:10 CEST 2011


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

> So people who say sys.platform shouldn't be used: what do you propose to
> do with Lib/plat-linux2 (or, more generally, Lib/plat-*)?

These directories look useless to me.
(IIRC, putting an obvious syntax error there does not trigger any failure
in the regression suite, showing that they are never imported)

That's orthogonal to whether sys.platform should be used or not, however.
During the language summit, someone (Marc-André) brought an interesting
point: the platform does external calls to system commands such as "uname",
which can be time-consuming.

We should at least document an example of using sys.platform.startswith()
rather than exact comparison.

Regards

Antoine.

----------

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


More information about the Python-bugs-list mailing list