Skip to content

Commit

Permalink
don't leak file descriptors in test
Browse files Browse the repository at this point in the history
if no f_in and f_out arguments are given, _ReadlineWrapper calls os.dup
on fd 0 and 1. Instead, just pass None, because the fds aren't needed
anyway in this test
  • Loading branch information
cfbolz committed Aug 24, 2024
1 parent ca18ff2 commit 20eb346
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_pyrepl/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def test_basic(self):

def test_get_line_buffer_returns_str(self):
reader = self.prepare_reader(code_to_events("\n"))
wrapper = _ReadlineWrapper(reader=reader)
wrapper = _ReadlineWrapper(f_in=None, f_out=None, reader=reader)
self.assertIs(type(wrapper.get_line_buffer()), str)

def test_multiline_edit(self):
Expand Down

0 comments on commit 20eb346

Please sign in to comment.