File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -706,7 +706,7 @@ def partition(
706706 if partition_table is None :
707707 raise ValueError ('Modification is marked as wipe but no partitioning table was provided' )
708708
709- if partition_table .MBR and len (modification .partitions ) > 3 :
709+ if partition_table .is_mbr () and len (modification .partitions ) > 3 :
710710 raise DiskError ('Too many partitions on disk, MBR disks can only have 3 primary partitions' )
711711
712712 # WARNING: the entire device will be wiped and all data lost
Original file line number Diff line number Diff line change @@ -202,6 +202,9 @@ class PartitionTable(Enum):
202202 GPT = 'gpt'
203203 MBR = 'msdos'
204204
205+ def is_mbr (self ) -> bool :
206+ return self == PartitionTable .MBR
207+
205208
206209class Units (Enum ):
207210 BINARY = 'binary'
You can’t perform that action at this time.
0 commit comments