Author: bugman Date: Wed Nov 27 18:13:29 2013 New Revision: 21686 URL: http://svn.gna.org/viewcvs/relax?rev=21686&view=rev Log: Improvements in the test_suite.clean_up.deletion() function. It is now more fail safe on Python 3 by completely avoiding the WindowsError checking. Modified: trunk/test_suite/clean_up.py Modified: trunk/test_suite/clean_up.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/clean_up.py?rev=21686&r1=21685&r2=21686&view=diff ============================================================================== --- trunk/test_suite/clean_up.py (original) +++ trunk/test_suite/clean_up.py Wed Nov 27 18:13:29 2013 @@ -51,10 +51,6 @@ # The variable. var = getattr(obj, name) - # Non-windows systems. - if not hasattr(builtins, 'WindowsError'): - builtins.WindowsError = None - # Attempt to remove the file or directory as well as the variable. try: if dir: @@ -63,8 +59,11 @@ delete(var, fail=False) del var + # Already deleted. + except OSError: + # Handle MS Windows strangeness. - except WindowsError: + except: sleep(3) try: if dir: @@ -73,12 +72,9 @@ delete(var, fail=False) # The files no longer exist? Oh well. - except WindowsError: + except: pass finally: del var - - # Already deleted. - except OSError: pass