> The main reason for keeping the compatibility is that the module is
> also being used outside the stdlib for Python versions starting from
> 2.4 and later. I don't want to maintain two separate versions.
Which projects use their own copy of platform.py? Where does this file come from?
Using subprocess sounds safer than adding a (theorical) TOCTTOU issue:
http://en.wikipedia.org/wiki/Time_of_check_to_time_of_use
If you are concerned about compatibility with Python 2.4, you should maintain platform outside the stdlib. The stdlib is regulary updated to the most recent syntax/modules. For example, "yield from" is now used in the stdlib of Python 3.4. |