Commit 8de2ca48 authored by Sushil Khanchi's avatar Sushil Khanchi 🐨
Browse files

diff: import BytesIO from io for easy usage

parent c7f3cabc1f3e
......@@ -6,7 +6,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
import logging
import io
from io import BytesIO
import attr
from ..errors import (
......@@ -277,7 +277,7 @@
# generator func to yield hunks
def in_chunks():
for hunk in header.hunks:
with io.BytesIO() as extracted:
with BytesIO() as extracted:
hunk.write(extracted)
yield extracted.getvalue()
......@@ -338,7 +338,7 @@
header = _insert_blob_index(chunk, ctx_from, ctx_to)
yield header
for hunk in chunk.hunks:
with io.BytesIO() as extracted:
with BytesIO() as extracted:
hunk.write(extracted)
yield extracted.getvalue()
for data in concat_resplit(in_chunks(), WRITE_BUFFER_SIZE):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment