]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111201: [pyrepl] Ensure optional platform-specific imports are optional (GH-119834)
authorŁukasz Langa <lukasz@langa.pl>
Fri, 31 May 2024 12:41:26 +0000 (08:41 -0400)
committerGitHub <noreply@github.com>
Fri, 31 May 2024 12:41:26 +0000 (14:41 +0200)
Lib/test/test_pyrepl/test_windows_console.py

index e87dfe99b1a17ddd0cd6709352cc065cfe5a5ce7..60392e231508b61481cb953159ba262b57699fa3 100644 (file)
@@ -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