Issue #24210: Silence a PendingDeprecationWarning warning in platform.platform().
This commit is contained in:
parent
6738b1157a
commit
1392f71c39
@ -114,6 +114,8 @@ __version__ = '1.0.7'
|
|||||||
import collections
|
import collections
|
||||||
import sys, os, re, subprocess
|
import sys, os, re, subprocess
|
||||||
|
|
||||||
|
import warnings
|
||||||
|
|
||||||
### Globals & Constants
|
### Globals & Constants
|
||||||
|
|
||||||
# Determine the platform's /dev/null device
|
# Determine the platform's /dev/null device
|
||||||
@ -1438,6 +1440,14 @@ def platform(aliased=0, terse=0):
|
|||||||
|
|
||||||
elif system in ('Linux',):
|
elif system in ('Linux',):
|
||||||
# Linux based systems
|
# Linux based systems
|
||||||
|
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('')
|
distname, distversion, distid = dist('')
|
||||||
if distname and not terse:
|
if distname and not terse:
|
||||||
platform = _platform(system, release, machine, processor,
|
platform = _platform(system, release, machine, processor,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user