Skip to content

Commit a7f55ad

Browse files
committed
improve arg handling logic for compression types
Signed-off-by: Zen <[email protected]>
1 parent b4eea0c commit a7f55ad

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/pycpio/writer/writer.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,15 @@ def __init__(self, cpio_entries: list, output_file: Path, structure=None, compre
1818

1919
self.structure = structure if structure is not None else HEADER_NEW
2020

21-
if compression is True:
22-
self.compression = True
23-
elif compression is False:
24-
self.compression = False
25-
elif isinstance(compression, str):
21+
self.compression = compression or False
22+
if isinstance(compression, str):
2623
compression = compression.lower()
2724
if compression == 'true':
2825
compression = True
2926
elif compression == 'false':
3027
compression = False
3128
self.compression = compression
29+
3230
self.xz_crc = xz_crc
3331

3432
def __bytes__(self):

0 commit comments

Comments
 (0)