Skip to content

Commit 2c1d220

Browse files
committed
fix #155
1 parent cf11503 commit 2c1d220

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

django_typer/management/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,6 +2378,11 @@ class write method.
23782378
msg = str(msg)
23792379
return super().write(msg=msg, style_func=style_func, ending=ending)
23802380

2381+
def flush(self):
2382+
# as of python 3.13, sometimes flush is called on a closed stream
2383+
if not getattr(self._out, "closed", False):
2384+
super().flush()
2385+
23812386

23822387
class TyperCommand(BaseCommand, metaclass=TyperCommandMeta):
23832388
"""

doc/source/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change Log
55
v2.6.0 (2024-12-03)
66
===================
77

8+
* Fixed `On Python 3.13, sometimes flush is called on the stream wrapped by OutputWrapper after it is closed. <https://github.com/django-commons/django-typer/issues/155>`_
89
* Implemented `Support Typer 0.15.x <https://github.com/django-commons/django-typer/issues/154>`_
910

1011
v2.5.0 (2024-11-29)

0 commit comments

Comments
 (0)