Skip to content

Commit 3123b60

Browse files
authored
Clean up strings in shaderconverter version check. NFC (#272)
Use a raw string for the regex to avoid warnings about `\.` being treated as an escape sequence, and use an f-string for string interpolation as is the modern python style.
1 parent 22129ec commit 3123b60

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/lit.cfg.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,16 @@ def setDeviceFeatures(config, device, compiler):
110110
MSCVersionOutput = subprocess.check_output(
111111
["metal-shaderconverter", "--version"]
112112
).decode("UTF-8")
113-
VersionRegex = re.compile("metal-irconverter version: ([0-9]+)\.([0-9]+)\.([0-9]+)")
113+
VersionRegex = re.compile(
114+
r"metal-irconverter version: ([0-9]+)\.([0-9]+)\.([0-9]+)")
114115
VersionMatch = VersionRegex.match(MSCVersionOutput)
115116
if VersionMatch:
116117
FullVersion = ".".join(VersionMatch.groups()[0:3])
117118
config.available_features.add("metal-shaderconverter-%s" % FullVersion)
118119
MajorVersion = int(VersionMatch.group(1))
119120
for I in range(1, MajorVersion + 1):
120-
config.available_features.add("metal-shaderconverter-%s.0.0-or-later" % I)
121+
config.available_features.add(
122+
f"metal-shaderconverter-{I}.0.0-or-later")
121123

122124
HLSLCompiler = ""
123125
if config.offloadtest_test_clang:

0 commit comments

Comments
 (0)