mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 02:15:36 -04:00
Small Python IO Cleanup
This commit is contained in:
parent
aeac85d176
commit
6a7e219021
2 changed files with 7 additions and 13 deletions
|
@ -264,18 +264,14 @@ def run():
|
|||
fs_is_supported = False
|
||||
|
||||
if os.path.isfile(PATH_PROCFS) and os.access(PATH_PROCFS, os.R_OK):
|
||||
procfile = open(PATH_PROCFS, 'r')
|
||||
filesystems = procfile.read()
|
||||
procfile.close()
|
||||
with open(PATH_PROCFS, 'r') as procfile:
|
||||
filesystems = procfile.read()
|
||||
filesystems = filesystems.replace("nodev", "").replace("\t", "").splitlines()
|
||||
|
||||
filesystems = filesystems.replace("nodev", "")
|
||||
filesystems = filesystems.replace("\t", "")
|
||||
filesystems = filesystems.splitlines()
|
||||
|
||||
# Check if the source filesystem is supported
|
||||
for fs in filesystems:
|
||||
if fs == sourcefs:
|
||||
fs_is_supported = True
|
||||
# Check if the source filesystem is supported
|
||||
for fs in filesystems:
|
||||
if fs == sourcefs:
|
||||
fs_is_supported = True
|
||||
|
||||
if not fs_is_supported:
|
||||
return "Bad filesystem", "sourcefs=\"{}\"".format(sourcefs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue