cpython: 6181146842ba (original) (raw)
Mercurial > cpython
changeset 96090:6181146842ba
Issue #24210: Silence a PendingDeprecationWarning warning in platform.platform(). [#24210]
Berker Peksag berker.peksag@gmail.com | |
---|---|
date | Sat, 16 May 2015 20:24:28 +0300 |
parents | 08829230079b |
children | ea61d8eb8a28 |
files | Lib/platform.py |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-)[+] [-] Lib/platform.py 12 |
line wrap: on
line diff
--- a/Lib/platform.py +++ b/Lib/platform.py @@ -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 @@ def platform(aliased=0, terse=0): elif system in ('Linux',): # Linux based systems
distname, distversion, distid = dist('')[](#l1.16)
with warnings.catch_warnings():[](#l1.17)
# see issue #1322 for more information[](#l1.18)
warnings.filterwarnings([](#l1.19)
'ignore',[](#l1.20)
'dist\(\) and linux_distribution\(\) '[](#l1.21)
'functions are deprecated .*',[](#l1.22)
PendingDeprecationWarning,[](#l1.23)
)[](#l1.24)
distname, distversion, distid = dist('')[](#l1.25) if distname and not terse:[](#l1.26) platform = _platform(system, release, machine, processor,[](#l1.27) 'with',[](#l1.28)