Skip to content

Commit a356762

Browse files
authored
Merge pull request #498 from etcwilde/ewilde/guard-parse-version
Guard parse_version
2 parents deede7f + 0177011 commit a356762

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Tests/Functional/lit.cfg

+7-3
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,14 @@ config.substitutions.append(('%{xctest_checker}', '%%{python} %s' % xctest_check
144144
config.substitutions.append( ('%{python}', pipes.quote(sys.executable)) )
145145

146146
# Conditionally report the Swift 5.5 Concurrency runtime as available depending on the OS and version.
147+
# Darwin is the only platform where this is a limitation.
147148
(run_os, run_vers) = config.os_info
148-
os_is_not_macOS = run_os != 'Darwin'
149-
macOS_version_is_recent_enough = parse_version(run_vers) >= parse_version('12.0')
150-
if os_is_not_macOS or macOS_version_is_recent_enough:
149+
if run_os == 'Darwin':
150+
assert run_vers != "", "No runtime version set."
151+
if parse_version(run_vers) >= parse_version('12.0'):
152+
config.available_features.add('concurrency_runtime')
153+
else:
154+
# Non-Darwin platforms have a concurrency runtime
151155
config.available_features.add('concurrency_runtime')
152156
if run_os == 'Windows':
153157
config.available_features.add('OS=windows')

0 commit comments

Comments
 (0)