From ac82f575c6de60eebf95d87ba5c9fb5f0665d86d Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Tue, 26 Mar 2024 13:54:40 +0900 Subject: [PATCH] Replaced yield with yield from to address latest sanity test Signed-off-by: Hideki Saito --- tests/unit/compat/mock.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/unit/compat/mock.py b/tests/unit/compat/mock.py index 0972cd2..c7d0183 100644 --- a/tests/unit/compat/mock.py +++ b/tests/unit/compat/mock.py @@ -64,8 +64,7 @@ if sys.version_info >= (3,) and sys.version_info < (3, 4, 4): # newline that our naive format() added data_as_list[-1] = data_as_list[-1][:-1] - for line in data_as_list: - yield line + yield from data_as_list def mock_open(mock=None, read_data=''): """ @@ -93,8 +92,7 @@ if sys.version_info >= (3,) and sys.version_info < (3, 4, 4): if handle.readline.return_value is not None: while True: yield handle.readline.return_value - for line in _data: - yield line + yield from _data global file_spec if file_spec is None: