batch 3 - update Python idiom to 3.7 using pyupgrade (#11343)

* batch 3 - update Python idiom to 3.7 using pyupgrade

* add changelog frag

* bring back sanity

* adjust test

* Apply suggestions from code review
This commit is contained in:
Alexei Znamensky
2025-12-31 10:18:52 +13:00
committed by GitHub
parent 543329cecb
commit e8f2b135ba
26 changed files with 74 additions and 51 deletions

View File

@@ -204,7 +204,7 @@ def main():
# TODO double check if this hack below is still needed.
# Check file for blank lines in effort to avoid "need more than 1 value to unpack" error.
try:
with open(path, "r") as f:
with open(path) as f:
lines = f.readlines()
# If the file gets edited, it returns true, so only edit the file if it has blank lines
@@ -222,7 +222,7 @@ def main():
with open(path, "w") as f:
f.writelines(line for line in lines if line.strip())
except IOError:
except OSError:
# No preexisting file to remove blank lines from
pass