Skip to content

Commit a094afe

Browse files
author
David Ungar
committed
handle conversion failure differently
1 parent 4c03e67 commit a094afe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/Driver/Dependencies/Inputs/update-dependencies-bad.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
returncode = subprocess.call([sys.argv[1], "--from-yaml",
4242
"--input-filename=" + primaryFile,
4343
"--output-filename=" + depsFile])
44-
# If the input is not valid YAML, just copy it over verbatim;
45-
# we're testing a case where we produced a corrupted output file.
4644
if returncode != 0:
47-
shutil.copyfile(primaryFile, depsFile)
45+
shutil.rmtree(depsFile, True)
46+
print("Failed to convert", os.path.basename(primaryFile))
47+
exit(1)
4848
except ValueError:
4949
pass
5050

test/Driver/Dependencies/Inputs/update-dependencies.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
"--input-filename=" + primaryFile,
4949
"--output-filename=" + depsFile])
5050
if returncode != 0:
51-
# If the input is not valid YAML, just copy it over verbatim;
52-
# we're testing a case where we produced a corrupted output file.
53-
shutil.copyfile(primaryFile, depsFile)
51+
shutil.rmtree(depsFile, True)
52+
print("Failed to convert", os.path.basename(primaryFile))
53+
exit(1)
5454
else:
5555
primaryFile = None
5656

0 commit comments

Comments
 (0)