diff -r 247f12fecf2b Doc/library/platform.rst --- a/Doc/library/platform.rst Sun Jan 05 12:00:31 2014 -0800 +++ b/Doc/library/platform.rst Tue Jan 07 10:59:57 2014 +0800 @@ -249,6 +249,11 @@ .. function:: linux_distribution(distname='', version='', id='', supported_dists=('SuSE','debian','redhat','mandrake',...), full_distribution_name=1) + .. deprecated:: 3.5 + This function will be deprecated in Python 3.5 and removed in Python 3.6. + The linux distributions use too many different ways of describing + themselves, so the functionality is left to a package. + Tries to determine the name of the Linux OS distribution name. ``supported_dists`` may be given to define the set of Linux distributions to diff -r 247f12fecf2b Lib/platform.py --- a/Lib/platform.py Sun Jan 05 12:00:31 2014 -0800 +++ b/Lib/platform.py Tue Jan 07 10:59:57 2014 +0800 @@ -113,6 +113,7 @@ import collections import sys, os, re, subprocess +from warnings import warn ### Globals & Constants @@ -318,6 +319,8 @@ args given as parameters. """ + warn("The dist()/linux_distribution() function will be deprecated in " + "Python 3.5 and removed in Python 3.6", PendingDeprecationWarning, 2) try: etc = os.listdir(_UNIXCONFDIR) except OSError: @@ -372,8 +375,7 @@ """ Portable popen() interface. """ - import warnings - warnings.warn('use os.popen instead', DeprecationWarning, stacklevel=2) + warn('use os.popen instead', DeprecationWarning, stacklevel=2) return os.popen(cmd, mode, bufsize) def _norm_version(version, build=''):