Skip to content

Commit

Permalink
Reblacken code after #8360 (#8609)
Browse files Browse the repository at this point in the history
Starting with Python 3.9, `with` allows parenthesized context managers,
which black will use when needed.
  • Loading branch information
SpecLad authored Oct 29, 2024
1 parent 9982156 commit bce96ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 9 additions & 2 deletions cvat-sdk/cvat_sdk/core/downloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,15 @@ def download_file(
except ValueError:
file_size = None

with atomic_writer(output_path, "wb") as fd, pbar.task(
total=file_size, desc="Downloading", unit_scale=True, unit="B", unit_divisor=1024
with (
atomic_writer(output_path, "wb") as fd,
pbar.task(
total=file_size,
desc="Downloading",
unit_scale=True,
unit="B",
unit_divisor=1024,
),
):
while True:
chunk = response.read(amt=CHUNK_SIZE, decode_content=False)
Expand Down
7 changes: 4 additions & 3 deletions tests/python/shared/fixtures/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,10 @@ def dump_db():

def create_compose_files(container_name_files):
for filename in container_name_files:
with open(filename.with_name(filename.name.replace(".tests", "")), "r") as dcf, open(
filename, "w"
) as ndcf:
with (
open(filename.with_name(filename.name.replace(".tests", "")), "r") as dcf,
open(filename, "w") as ndcf,
):
dc_config = yaml.safe_load(dcf)

for service_name, service_config in dc_config["services"].items():
Expand Down

0 comments on commit bce96ea

Please sign in to comment.