Skip to content

Commit 5d83648

Browse files
committed
fix: tests failed by wrong conflict fix
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
1 parent e43fc60 commit 5d83648

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Lib/_pyrepl/unix_console.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,10 @@ def restore(self):
386386
self.__maybe_write_code(self._rmkx)
387387
self.flushoutput()
388388
try:
389-
tcsetattr(self.input_fd, termios.TCSADRAIN, self.__svtermstate)
390-
# Reset the state for the next prepare() call.
391-
self.__svtermstate = None
389+
if self.__svtermstate is not None:
390+
tcsetattr(self.input_fd, termios.TCSADRAIN, self.__svtermstate)
391+
# Reset the state for the next prepare() call.
392+
self.__svtermstate = None
392393
except termios.error as e:
393394
if e.args[0] != errno.EIO:
394395
raise

Lib/test/test_pyrepl/test_unix_console.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ def test_wait_reentry_protection(self, _os_write):
320320

321321
console._polling_thread = None
322322
console.restore()
323+
323324
@unittest.skipUnless(sys.platform == "darwin", "requires macOS")
324325
def test_restore_with_invalid_environ_on_macos(self, _os_write):
325326
# gh-128636 for macOS

0 commit comments

Comments
 (0)