# HG changeset patch # User Oleg Oshmyan # Date 1292891337 -7200 # Node ID 855bdfeb32a67b76b055553093d0a04f91d1e1b8 # Parent 693a938bdeee62c754d0a18eecce9e12ea8470ec NameErrors within call() are now reported diff -r 693a938bdeee -r 855bdfeb32a6 testcases.py --- a/testcases.py Tue Dec 21 02:24:18 2010 +0200 +++ b/testcases.py Tue Dec 21 02:28:57 2010 +0200 @@ -101,6 +101,7 @@ else: # TODO: implement Win32 call() pass + call = None else: # Make SIGCHLD interrupt sleep() and select() def bury_child(signum, frame): @@ -445,9 +446,9 @@ # FIXME: this U doesn't do anything good for the child process, does it? with open(inputdatafname, 'rU') as infile: with tempfile.TemporaryFile('w+') if options.erase and not case.validator else open(case.problem.config.outname, 'w+') as outfile: - try: + if call is not None: call(case.problem.config.path, case=case, stdin=infile, stdout=outfile, stderr=devnull, universal_newlines=True, bufsize=-1, preexec_fn=preexec_fn) - except NameError: + else: try: try: case.process = Popen(case.problem.config.path, stdin=infile, stdout=outfile, stderr=devnull, universal_newlines=True, bufsize=-1, preexec_fn=preexec_fn) @@ -499,9 +500,9 @@ return case.validate(outfile) else: case.infile.copy(case.problem.config.inname) - try: + if call is not None: call(case.problem.config.path, case=case, stdin=devnull, stdout=devnull, stderr=STDOUT, preexec_fn=preexec_fn) - except NameError: + else: try: try: case.process = Popen(case.problem.config.path, stdin=devnull, stdout=devnull, stderr=STDOUT, preexec_fn=preexec_fn)