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

Antoine Pitrou report at bugs.python.org
Wed Jul 20 01:26:16 CEST 2011


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

Le mardi 19 juillet 2011 à 23:20 +0000, STINNER Victor a écrit :
> STINNER Victor <victor.stinner at haypocalc.com> added the comment:
> 
> > Your patch looks fine to me, except for this:
> > -        if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
> > -                        'freebsd7', 'freebsd8')
> > -            or platform.startswith("gnukfreebsd")):
> > +        if os.uname()[0] in ('Linux', 'FreeBSD'):
> > 
> > Why not use platform.system(), to be consistent?
> 
> I'm not sure that thp platform module can be used in setup.py 
> (bootstrap issue?). It should be tested.

Why don't you just use platform.startswith? It would avoid introducing
bugs due to subtle differences between uname, platform or
platform.system.

----------

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


More information about the Python-bugs-list mailing list