mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-01-23 12:37:05 +00:00
Fixed SIM117 (multiple-with-statements): Use a single with
statement with multiple contexts instead of nested with
statements
This commit is contained in:
parent
bd0cb22467
commit
9896bfb765
@ -72,9 +72,8 @@ def scan_files(collector):
|
||||
if not os.path.exists(fn):
|
||||
continue
|
||||
if fn[-3:] == '.gz':
|
||||
with tempfile.NamedTemporaryFile(delete=False) as tmp_file:
|
||||
with gzip.open(fn, 'rb') as f:
|
||||
shutil.copyfileobj(f, tmp_file)
|
||||
with tempfile.NamedTemporaryFile(delete=False) as tmp_file, gzip.open(fn, 'rb') as f:
|
||||
shutil.copyfileobj(f, tmp_file)
|
||||
|
||||
if VERBOSE:
|
||||
print("Processing file", fn, "...")
|
||||
|
Loading…
Reference in New Issue
Block a user