summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal/tests/formathelper.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-05-10 23:42:09 (GMT)
committerGitHub <noreply@github.com>2022-05-10 23:42:09 (GMT)
commitdfdebda0524ce4cc945621d69eef77a64f260095 (patch)
treeabb5abf4d8e0ccce769d80f1e2370ffdc2b2d922 /Modules/_decimal/tests/formathelper.py
parent303e5d57bc8aeb48ae5ed9dae6ca6e7efeb66122 (diff)
downloadcpython-dfdebda0524ce4cc945621d69eef77a64f260095.zip
cpython-dfdebda0524ce4cc945621d69eef77a64f260095.tar.gz
cpython-dfdebda0524ce4cc945621d69eef77a64f260095.tar.bz2
gh-92584: test_decimal uses shutil.which() (#92640)
test_decimal now uses shutil.which() rather than deprecated distutils.spawn.find_executable().
Diffstat (limited to 'Modules/_decimal/tests/formathelper.py')
-rw-r--r--Modules/_decimal/tests/formathelper.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_decimal/tests/formathelper.py b/Modules/_decimal/tests/formathelper.py
index c3daacf..f4a6a1c 100644
--- a/Modules/_decimal/tests/formathelper.py
+++ b/Modules/_decimal/tests/formathelper.py
@@ -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'])
@@ -139,7 +139,7 @@ else:
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: