mirror of https://github.com/python/cpython
gh-92584: test_decimal uses shutil.which() (#92640)
test_decimal now uses shutil.which() rather than deprecated distutils.spawn.find_executable().
This commit is contained in:
parent
303e5d57bc
commit
dfdebda052
|
@ -32,7 +32,7 @@
|
||||||
import os, sys, locale, random
|
import os, sys, locale, random
|
||||||
import platform, subprocess
|
import platform, subprocess
|
||||||
from test.support.import_helper import import_fresh_module
|
from test.support.import_helper import import_fresh_module
|
||||||
from distutils.spawn import find_executable
|
from shutil import which
|
||||||
|
|
||||||
C = import_fresh_module('decimal', fresh=['_decimal'])
|
C = import_fresh_module('decimal', fresh=['_decimal'])
|
||||||
P = import_fresh_module('decimal', blocked=['_decimal'])
|
P = import_fresh_module('decimal', blocked=['_decimal'])
|
||||||
|
@ -139,7 +139,7 @@ else:
|
||||||
with open("/var/lib/locales/supported.d/local") as f:
|
with open("/var/lib/locales/supported.d/local") as f:
|
||||||
locale_list = [loc.split()[0] for loc in f.readlines() \
|
locale_list = [loc.split()[0] for loc in f.readlines() \
|
||||||
if not loc.startswith('#')]
|
if not loc.startswith('#')]
|
||||||
elif find_executable('locale'):
|
elif which('locale'):
|
||||||
locale_list = subprocess.Popen(["locale", "-a"],
|
locale_list = subprocess.Popen(["locale", "-a"],
|
||||||
stdout=subprocess.PIPE).communicate()[0]
|
stdout=subprocess.PIPE).communicate()[0]
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue