diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2015-05-16 17:24:28 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2015-05-16 17:24:28 (GMT) |
commit | 1392f71c3927c9d81969200f5dfff9fb832cde0b (patch) | |
tree | 1c8690f2b2a56b12a0a02c8d41f8f6248f6f210b /Lib/platform.py | |
parent | 6738b1157a8153192369ff91798731ce29540c66 (diff) | |
download | cpython-1392f71c3927c9d81969200f5dfff9fb832cde0b.zip cpython-1392f71c3927c9d81969200f5dfff9fb832cde0b.tar.gz cpython-1392f71c3927c9d81969200f5dfff9fb832cde0b.tar.bz2 |
Issue #24210: Silence a PendingDeprecationWarning warning in platform.platform().
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 52a009a..6345184 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -114,6 +114,8 @@ __version__ = '1.0.7' import collections import sys, os, re, subprocess +import warnings + ### Globals & Constants # Determine the platform's /dev/null device @@ -1438,7 +1440,15 @@ def platform(aliased=0, terse=0): elif system in ('Linux',): # Linux based systems - distname, distversion, distid = dist('') + with warnings.catch_warnings(): + # see issue #1322 for more information + warnings.filterwarnings( + 'ignore', + 'dist\(\) and linux_distribution\(\) ' + 'functions are deprecated .*', + PendingDeprecationWarning, + ) + distname, distversion, distid = dist('') if distname and not terse: platform = _platform(system, release, machine, processor, 'with', |