Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-02-07 18:53:55 +0100
committerAnton Hvornum <anton@hvornum.se>2021-02-07 18:53:55 +0100
commit4349512ef3f24c48c1c0903064d518e44c11101b (patch)
tree91a14c36c07e3fd19274e6d12ad67d72377179d8 /archinstall
parenta9d49a52eca85a471e79018fdc952190e2071e10 (diff)
Added error handling for BlockDevice() that was given no information.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index d999e626..5a2857f3 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -14,7 +14,12 @@ GPT = 0b00000001
#libc.mount.argtypes = (ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_ulong, ctypes.c_char_p)
class BlockDevice():
- def __init__(self, path, info={}):
+ def __init__(self, path, info=None):
+ if not info:
+ # If we don't give any information, we need to auto-fill it.
+ # Otherwise any subsequent usage will break.
+ info = all_disks().get(path, {})
+
self.path = path
self.info = info
self.part_cache = OrderedDict()