Skip to content

Commit

Permalink
Fix ValueError: I/O operation on closed file.
Browse files Browse the repository at this point in the history
  • Loading branch information
tchalupnik committed Jun 3, 2024
1 parent 6a58564 commit 8045b8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/prompt_toolkit/application/current.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def __repr__(self) -> str:

@property
def input(self) -> Input:
if self._input is None:
if self._input is None or self._input.closed:
from prompt_toolkit.input.defaults import create_input

self._input = create_input()
return self._input

@property
def output(self) -> Output:
if self._output is None:
if self._output is None or (self._output.stdout and self._output.stdout.closed):
from prompt_toolkit.output.defaults import create_output

self._output = create_output()
Expand Down

0 comments on commit 8045b8f

Please sign in to comment.