Skip to content

Commit

Permalink
gh-92584: test_decimal uses shutil.which() (#92640)
Browse files Browse the repository at this point in the history
test_decimal now uses shutil.which() rather than deprecated
distutils.spawn.find_executable().
  • Loading branch information
vstinner authored May 10, 2022
1 parent 303e5d5 commit dfdebda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Modules/_decimal/tests/formathelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import os, sys, locale, random
import platform, subprocess
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'])
P = import_fresh_module('decimal', blocked=['_decimal'])
Expand Down Expand Up @@ -139,7 +139,7 @@
with open("/var/lib/locales/supported.d/local") as f:
locale_list = [loc.split()[0] for loc in f.readlines() \
if not loc.startswith('#')]
elif find_executable('locale'):
elif which('locale'):
locale_list = subprocess.Popen(["locale", "-a"],
stdout=subprocess.PIPE).communicate()[0]
try:
Expand Down

0 comments on commit dfdebda

Please sign in to comment.