@@ -413,12 +413,9 @@ def extract_archive(path, dest_dir):
413413 raise ValueError (f"unknown archive format: { path } " )
414414
415415 if args :
416- with (
417- ifh ,
418- subprocess .Popen (
419- args , cwd = str (dest_dir ), bufsize = 0 , stdin = subprocess .PIPE
420- ) as p ,
421- ):
416+ with ifh , subprocess .Popen (
417+ args , cwd = str (dest_dir ), bufsize = 0 , stdin = subprocess .PIPE
418+ ) as p :
422419 while True :
423420 if not pipe_stdin :
424421 break
@@ -530,13 +527,10 @@ def repack_archive(
530527 with rename_after_close (dest , "wb" ) as fh :
531528 ctx = ZstdCompressor ()
532529 if orig_typ in ("exec" , None ):
533- with (
534- ctx .stream_writer (fh ) as compressor ,
535- tarfile .open (
536- fileobj = compressor ,
537- mode = "w:" ,
538- ) as tar ,
539- ):
530+ with ctx .stream_writer (fh ) as compressor , tarfile .open (
531+ fileobj = compressor ,
532+ mode = "w:" ,
533+ ) as tar :
540534 tarinfo = tarfile .TarInfo ()
541535 tarinfo .name = filter (orig .name ) if filter else orig .name
542536 st = orig .stat ()
@@ -549,10 +543,9 @@ def repack_archive(
549543 assert typ == "tar"
550544 zip = zipfile .ZipFile (ifh )
551545 # Convert the zip stream to a tar on the fly.
552- with (
553- ctx .stream_writer (fh ) as compressor ,
554- tarfile .open (fileobj = compressor , mode = "w:" ) as tar ,
555- ):
546+ with ctx .stream_writer (fh ) as compressor , tarfile .open (
547+ fileobj = compressor , mode = "w:"
548+ ) as tar :
556549 for zipinfo in zip .infolist ():
557550 if zipinfo .is_dir ():
558551 continue
@@ -594,14 +587,11 @@ def repack_archive(
594587 # To apply the filter, we need to open the tar stream and
595588 # tweak it.
596589 origtar = tarfile .open (fileobj = ifh , mode = "r|" )
597- with (
598- ctx .stream_writer (fh ) as compressor ,
599- tarfile .open (
600- fileobj = compressor ,
601- mode = "w:" ,
602- format = origtar .format ,
603- ) as tar ,
604- ):
590+ with ctx .stream_writer (fh ) as compressor , tarfile .open (
591+ fileobj = compressor ,
592+ mode = "w:" ,
593+ format = origtar .format ,
594+ ) as tar :
605595 for tarinfo in origtar :
606596 if tarinfo .isdir ():
607597 continue
0 commit comments