Skip to content

Commit dfdebda

Browse files
authored
gh-92584: test_decimal uses shutil.which() (#92640)
test_decimal now uses shutil.which() rather than deprecated distutils.spawn.find_executable().
1 parent 303e5d5 commit dfdebda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/_decimal/tests/formathelper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import os, sys, locale, random
3333
import platform, subprocess
3434
from test.support.import_helper import import_fresh_module
35-
from distutils.spawn import find_executable
35+
from shutil import which
3636

3737
C = import_fresh_module('decimal', fresh=['_decimal'])
3838
P = import_fresh_module('decimal', blocked=['_decimal'])
@@ -139,7 +139,7 @@
139139
with open("/var/lib/locales/supported.d/local") as f:
140140
locale_list = [loc.split()[0] for loc in f.readlines() \
141141
if not loc.startswith('#')]
142-
elif find_executable('locale'):
142+
elif which('locale'):
143143
locale_list = subprocess.Popen(["locale", "-a"],
144144
stdout=subprocess.PIPE).communicate()[0]
145145
try:

0 commit comments

Comments
 (0)