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-06-06 15:31:51 +0200
committerAnton Hvornum <anton@hvornum.se>2021-06-06 15:31:51 +0200
commitf9774af2cc4dc113293664d44de1a7598348326e (patch)
treef321976716257ad2fdcaefa58811f62e6ca1702d /archinstall
parent71b6efab69cab9bd97c647c7ccc7667149967a5c (diff)
As of Python 3.6 and 3.7, dictionaries are ordered by insertion by default. We there for no longer need to use OrderedDict for our dictionaries where this logic is required.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 3fda5da6..1ac6d9b0 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -2,7 +2,6 @@ import glob
import pathlib
import re
import time
-from collections import OrderedDict
from typing import Optional
from .general import *
@@ -30,7 +29,7 @@ class BlockDevice:
self.path = path
self.info = info
self.keep_partitions = True
- self.part_cache = OrderedDict()
+ self.part_cache = {}
# TODO: Currently disk encryption is a BIT misleading.
# It's actually partition-encryption, but for future-proofing this
@@ -177,7 +176,7 @@ class BlockDevice:
return False
def flush_cache(self):
- self.part_cache = OrderedDict()
+ self.part_cache = {}
class Partition:
@@ -673,7 +672,7 @@ def device_state(name, *args, **kwargs):
# lsblk --json -l -n -o path
def all_disks(*args, **kwargs):
kwargs.setdefault("partitions", False)
- drives = OrderedDict()
+ drives = {}
# for drive in json.loads(sys_command(f'losetup --json', *args, **lkwargs, hide_from_log=True)).decode('UTF_8')['loopdevices']:
for drive in json.loads(b''.join(SysCommand('lsblk --json -l -n -o path,size,type,mountpoint,label,pkname,model')).decode('UTF_8'))['blockdevices']:
if not kwargs['partitions'] and drive['type'] == 'part':