bpo-37359: Fix regrtest --cleanup (GH-14336) · python/cpython@9bbf4d7

Original file line numberDiff line numberDiff line change

@@ -592,8 +592,8 @@ def cleanup(self):

592592

path = os.path.join(self.tmp_dir, 'test_python_*')

593593

print("Cleanup %s directory" % self.tmp_dir)

594594

for name in glob.glob(path):

595-

print("Remove directory: %s" % name)

596595

if os.path.isdir(name):

596+

print("Remove directory: %s" % name)

597597

support.rmtree(name)

598598

else:

599599

print("Remove file: %s" % name)