From 9d45688cafd8ddc033707614094d2de3bf63913c Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Mon, 7 Feb 2011 17:14:07 -0300 Subject: [PATCH] attempt to fix rmtree Windows issues in test case --- runtests.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runtests.py b/runtests.py index 844477ba..acfcb609 100644 --- a/runtests.py +++ b/runtests.py @@ -6,6 +6,7 @@ import re import gc import codecs import shutil +import time import unittest import doctest import operator @@ -816,7 +817,13 @@ class EndToEndTest(unittest.TestCase): def tearDown(self): if self.cleanup_workdir: - shutil.rmtree(self.workdir) + for trial in range(5): + try: + shutil.rmtree(self.workdir) + except OSError: + time.sleep(0.1) + else: + break os.chdir(self.old_dir) def runTest(self): -- 2.26.2