From: Lisandro Dalcin Date: Mon, 7 Feb 2011 20:14:07 +0000 (-0300) Subject: attempt to fix rmtree Windows issues in test case X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9d45688cafd8ddc033707614094d2de3bf63913c;p=cython.git attempt to fix rmtree Windows issues in test case --- 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):