From 4c387a76f3ac8509c29634f4bbda6c37a67550d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Langa?= Date: Fri, 31 May 2024 08:41:26 -0400 Subject: [PATCH] gh-111201: [pyrepl] Ensure optional platform-specific imports are optional (GH-119834) --- Lib/test/test_pyrepl/test_windows_console.py | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Lib/test/test_pyrepl/test_windows_console.py b/Lib/test/test_pyrepl/test_windows_console.py index e87dfe99b1a..60392e23150 100644 --- a/Lib/test/test_pyrepl/test_windows_console.py +++ b/Lib/test/test_pyrepl/test_windows_console.py @@ -1,24 +1,24 @@ import itertools import sys import unittest -from _pyrepl.console import Event, Console -from _pyrepl.windows_console import ( - MOVE_LEFT, - MOVE_RIGHT, - MOVE_UP, - MOVE_DOWN, - ERASE_IN_LINE, -) + from functools import partial from typing import Iterable -from unittest import TestCase, main -from unittest.mock import MagicMock, call, patch, ANY +from unittest import TestCase +from unittest.mock import MagicMock, call from .support import handle_all_events, code_to_events try: - from _pyrepl.console import Event - from _pyrepl.windows_console import WindowsConsole + from _pyrepl.console import Event, Console + from _pyrepl.windows_console import ( + WindowsConsole, + MOVE_LEFT, + MOVE_RIGHT, + MOVE_UP, + MOVE_DOWN, + ERASE_IN_LINE, + ) except ImportError: pass