Removes the comprehension expression with :=

Prevents flake8 error on Focal.
This commit is contained in:
Carlos Nihelton 2022-05-10 09:58:59 -03:00
parent f9d2d3100e
commit a8e3f9a218
No known key found for this signature in database
GPG Key ID: 6FE346D245197E9A
1 changed files with 8 additions and 6 deletions

View File

@ -35,14 +35,16 @@ USERNAME_REGEX = r'[a-z_][a-z0-9_-]*'
def _reserved_names_from_file(path: str) -> Set[str]: def _reserved_names_from_file(path: str) -> Set[str]:
names = set()
if os.path.exists(path): if os.path.exists(path):
with open(path, "r") as f: with open(path, "r") as f:
return { for line in f:
s.split()[0] for line in f.readlines() line = line.strip()
if (s := line.strip()) and not s.startswith("#") if not line or line.startswith('#'):
} continue
else: names.add(line.split()[0])
return set()
return names
class IdentityController(SubiquityController): class IdentityController(SubiquityController):