Skip to content

Commit 140b3cc

Browse files
authored
[test] Tweak check-is-forwarding-module.py to handle multiple inputs (#23313)
And fix the error message printing while I'm at it. I don't have a public test for this at the moment, but an Apple- internal tool will use it. I hope to upstream that tool in the future.
1 parent 450aba7 commit 140b3cc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import sys
22

3-
with open(sys.argv[1], 'r') as yaml_file:
4-
# Forwarding files are YAML files that start with '---'
5-
if yaml_file.read(3) != '---':
6-
print("swiftmodule '%s' is not a forwarding module!")
7-
sys.exit(1)
3+
for input_path in sys.argv[1:]:
4+
with open(input_path, 'r') as yaml_file:
5+
# Forwarding files are YAML files that start with '---'
6+
if yaml_file.read(3) != '---':
7+
print("swiftmodule '%s' is not a forwarding module!" % input_path)
8+
sys.exit(1)

0 commit comments

Comments
 (0)