Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: use assignment expression in stdlib (combined PR) #8122

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions Lib/_markupbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ def updatepos(self, i, j):
if i >= j:
return j
rawdata = self.rawdata
nlines = rawdata.count("\n", i, j)
if nlines:
if (nlines := rawdata.count("\n", i, j)):
self.lineno = self.lineno + nlines
pos = rawdata.rindex("\n", i, j) # Should not fail
self.offset = j-(pos+1)
Expand Down Expand Up @@ -291,8 +290,7 @@ def _parse_doctype_attlist(self, i, declstartpos):
if not c:
return -1
if c in "'\"":
m = _declstringlit_match(rawdata, j)
if m:
if (m := _declstringlit_match(rawdata, j)):
j = m.end()
else:
return -1
Expand Down Expand Up @@ -359,8 +357,7 @@ def _parse_doctype_entity(self, i, declstartpos):
if not c:
return -1
if c in "'\"":
m = _declstringlit_match(rawdata, j)
if m:
if (m := _declstringlit_match(rawdata, j)):
j = m.end()
else:
return -1 # incomplete
Expand All @@ -378,8 +375,7 @@ def _scan_name(self, i, declstartpos):
n = len(rawdata)
if i == n:
return None, -1
m = _declname_match(rawdata, i)
if m:
if (m := _declname_match(rawdata, i)):
s = m.group()
name = s.strip()
if (i + len(s)) == n:
Expand Down
3 changes: 1 addition & 2 deletions Lib/_osx_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ def _check_for_unavailable_sdk(_config_vars):
# to /usr and /System/Library by either a standalone CLT
# package or the CLT component within Xcode.
cflags = _config_vars.get('CFLAGS', '')
m = re.search(r'-isysroot\s+(\S+)', cflags)
if m is not None:
if (m := re.search(r'-isysroot\s+(\S+)', cflags)) is not None:
sdk = m.group(1)
if not os.path.exists(sdk):
for cv in _UNIVERSAL_CONFIG_VARS:
Expand Down
Loading