# HG changeset patch # User Oleg Oshmyan # Date 1307737373 -3600 # Node ID 93bf6b333c99c8aa725b5b4a7e7755c1a368c14a # Parent 8f02b97f8073c29e5ed5bdd75bf36b5c1ac3b1b8 Some broken output validators on Win32 no longer get access-denied errors diff -r 8f02b97f8073 -r 93bf6b333c99 upreckon/testcases.py --- a/upreckon/testcases.py Wed Jun 08 21:22:20 2011 +0100 +++ b/upreckon/testcases.py Fri Jun 10 21:22:53 2011 +0100 @@ -238,15 +238,15 @@ inputdatafname = case.problem.config.inname contextmgr = Copying(case.infile, inputdatafname) with contextmgr: - with open(inputdatafname) as infile: - with tempfile.TemporaryFile('w+') if options.erase and (not case.validator or callable(case.validator)) else open(case.problem.config.outname, 'w+') as outfile: + with tempfile.TemporaryFile('w+') if options.erase and (not case.validator or callable(case.validator)) else open(case.problem.config.outname, 'w+') as outfile: + with open(inputdatafname) as infile: call(case.problem.config.path, case=case, stdin=infile, stdout=outfile, stderr=devnull) - if config.globalconf.force_zero_exitcode and case.process.returncode or case.process.returncode < 0: - raise NonZeroExitCode(case.process.returncode) - case.has_called_back = True - callback() - outfile.seek(0) - return case.validate(outfile) + if config.globalconf.force_zero_exitcode and case.process.returncode or case.process.returncode < 0: + raise NonZeroExitCode(case.process.returncode) + case.has_called_back = True + callback() + outfile.seek(0) + return case.validate(outfile) else: case.infile.copy(case.problem.config.inname) call(case.problem.config.path, case=case, stdin=devnull, stdout=devnull, stderr=STDOUT)