summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-05-16 17:24:28 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-05-16 17:24:28 (GMT)
commit1392f71c3927c9d81969200f5dfff9fb832cde0b (patch)
tree1c8690f2b2a56b12a0a02c8d41f8f6248f6f210b /Lib/platform.py
parent6738b1157a8153192369ff91798731ce29540c66 (diff)
downloadcpython-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-xLib/platform.py12
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',