mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user