Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
barseghyanartur committed Jan 11, 2023
1 parent 56f34e5 commit 3e9f3f7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/faker_file/providers/docx_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ def docx_file(
content=content,
)

stream = BytesIO()
document = Document()
document.add_paragraph(content)
document.save(stream)
stream.seek(0)
with BytesIO() as _fake_file:
document = Document()
document.add_paragraph(content)
document.save(_fake_file)
_fake_file.seek(0)

storage.write_bytes(filename, stream.read())
storage.write_bytes(filename, _fake_file.read())

# Generic
file_name = StringValue(storage.relpath(filename))
Expand Down

0 comments on commit 3e9f3f7

Please sign in to comment.