X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=tests%2Ftest_remove_old_files.py;fp=tests%2Ftest_remove_old_files.py;h=95dd98cb46111219b7f7df24f43d9a39bdd09e64;hb=f49c1ad164e7eb7eda2c52344282401589d0f66f;hp=ea36506dd4d4198acc97dd31abd7e8fae64581a6;hpb=c3c81973f94f6b4617a2271bbaeef01ecad502bb;p=ppu.git diff --git a/tests/test_remove_old_files.py b/tests/test_remove_old_files.py index ea36506..95dd98c 100755 --- a/tests/test_remove_old_files.py +++ b/tests/test_remove_old_files.py @@ -6,17 +6,14 @@ import shutil import subprocess import sys from tempfile import mkdtemp +from find_in_path import find_in_path tmp_dir = None old_time = time() - 1000 * 24 * 3600 # 1000 days ago -for path in os.environ["PATH"].split(os.pathsep): - path = path.strip('"') - test_prog_path = os.path.join(path, 'remove-old-files.py') - if os.path.exists(test_prog_path): - break -else: +test_prog_path = find_in_path('remove-old-files.py') +if not test_prog_path: sys.exit("Cannot find remove-old-files.py in %s" % os.environ["PATH"])