Skip to content

Commit e20fe58

Browse files
aduh95cclauss
andauthored
Apply suggestions from code review
Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent 9158221 commit e20fe58

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

pylib/gyp/xcode_emulation.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,17 +1538,15 @@ def CLTVersion():
15381538
for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]:
15391539
try:
15401540
output = GetStdout(["/usr/sbin/pkgutil", "--pkg-info", key])
1541-
m = re.search(regex, output)
1542-
if m:
1541+
if m := re.search(regex, output):
15431542
return m.groupdict()["version"]
15441543
except (GypError, OSError):
15451544
continue
15461545

15471546
regex = re.compile(r"Command Line Tools for Xcode\s+(?P<version>\S+)")
15481547
try:
15491548
output = GetStdout(["/usr/sbin/softwareupdate", "--history"])
1550-
m = re.search(regex, output)
1551-
if m:
1549+
if m := re.search(regex, output):
15521550
return m.groupdict()["version"]
15531551
except (GypError, OSError):
15541552
return None

0 commit comments

Comments
 (0)