(original) (raw)
changeset: 96090:6181146842ba parent: 96087:08829230079b user: Berker Peksag berker.peksag@gmail.com date: Sat May 16 20:24:28 2015 +0300 files: Lib/platform.py description: Issue #24210: Silence a PendingDeprecationWarning warning in platform.platform(). diff -r 08829230079b -r 6181146842ba Lib/platform.py --- a/Lib/platform.py Sat May 16 10:10:21 2015 -0400 +++ b/Lib/platform.py Sat May 16 20:24:28 2015 +0300 @@ -114,6 +114,8 @@ import collections import sys, os, re, subprocess +import warnings + ### Globals & Constants # Determine the platform's /dev/null device @@ -1438,7 +1440,15 @@ 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', /berker.peksag@gmail.com