Skip to content

Commit a894ba6

Browse files
committed
Swift: make test run in Python 3.8
1 parent a86d0fc commit a894ba6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

swift/codegen/test/test_qlgen.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ def generate_classes(opts, renderer):
5252
stub_files = set()
5353
base_files = set()
5454
for f in files:
55-
if f.is_relative_to(stub_path()):
55+
try:
5656
stub_files.add(f.relative_to(stub_path()))
57-
elif f.is_relative_to(ql_output_path()):
58-
base_files.add(f.relative_to(ql_output_path()))
59-
else:
60-
assert False, f"{f} is in wrong directory"
57+
except ValueError:
58+
try:
59+
base_files.add(f.relative_to(ql_output_path()))
60+
except ValueError:
61+
assert False, f"{f} is in wrong directory"
6162
assert stub_files == base_files
6263
return {
6364
str(f): (ret[stub_path() / f], ret[ql_output_path() / f])

0 commit comments

Comments
 (0)